home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume35 / mbox / part13 < prev    next >
Encoding:
Text File  |  1993-02-04  |  54.5 KB  |  2,004 lines

  1. Newsgroups: comp.sources.misc
  2. From: Volker.Schuermann@unnet.w.open.de (Volker Schuermann)
  3. Subject: v35i048:  mbox - ix/Mbox, A BBS for UNIX and MINIX v1.6 PL10j7, Part13/15
  4. Message-ID: <1993Feb5.185943.10801@sparky.imd.sterling.com>
  5. X-Md4-Signature: e34ad2971cd0d5262a8f8a3dbfdb8a5a
  6. Date: Fri, 5 Feb 1993 18:59:43 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Volker.Schuermann@unnet.w.open.de (Volker Schuermann)
  10. Posting-number: Volume 35, Issue 48
  11. Archive-name: mbox/part13
  12. Environment: MINIX, ISC, ESIX, SVR3
  13. Supersedes: mbox: Volume 31, Issue 16-27
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then feed it
  17. # into a shell via "sh file" or similar.  To overwrite existing files,
  18. # type "sh file -c".
  19. # Contents:  Announce10j7 etc/english.shorth src/ctrlx.c src/defs.h
  20. #   src/faces.c src/suchen.c src/weiterl.c wendy/block.c wendy/rtf.c
  21. #   wendy/screen.c wendy/wendy.dok.U
  22. # Wrapped by kent@sparky on Fri Feb  5 12:18:17 1993
  23. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  24. echo If this archive is complete, you will see the following message:
  25. echo '          "shar: End of archive 13 (of 15)."'
  26. if test -f 'Announce10j7' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'Announce10j7'\"
  28. else
  29.   echo shar: Extracting \"'Announce10j7'\" \(5165 characters\)
  30.   sed "s/^X//" >'Announce10j7' <<'END_OF_FILE'
  31. XAnnouncement for the BBS-package ix/MBox 1.6 PL10j7                25.01.1993
  32. X
  33. X
  34. XThe package includes a BBS for UNIX. The following derivations and compilers
  35. Xhave been tested:
  36. X
  37. X- MINIX 386 (You have to have the 386 version!) with BCC
  38. X
  39. X- MINIX 386 with GCC 1.37 (with or w/o ESTDIO-patches)
  40. X
  41. X- ESIX SVR3 with CC (MSC) or GCC
  42. X
  43. X- ISC 2.21 with "Shared Libs"
  44. X
  45. X- DELL UNIX 2.1 SVR4 with GCC 2.1
  46. X
  47. X- LINUX 0.99pl2 with GCC 2.3.3
  48. X
  49. XIf you don't have one of those systems or anything that's compatible to
  50. Xany of them, you may stop reading now!
  51. X
  52. XNOTE: The 64+64 limitation of Coherent and plain MINIX makes it impossible
  53. X      to run ix/MBox BBS! The BBS itself needs more than 170kB of memory!
  54. X
  55. X
  56. XFor all who are still reading, some other requirements. The ix/MBox uses
  57. Xsome UNIX services to stay compatible to the UNIX world and to make updates
  58. Xmore easy. You need:
  59. X
  60. X- a mailer like SMAIL (RMAIL) or UMAIL 
  61. X
  62. X- a news-package B/C-NEWS (INEWS) or WNEWS
  63. X
  64. X- a uucp-system like HDB, Taylor or MNXUUCP or UUCP1.2
  65. X
  66. X(The packages UMAIL and WNEWS are MINIX stuff by Fred v. Kempen, UUCP1.2
  67. Xis the (best) UUCP-package for MINIX by Will Rose)
  68. X
  69. X
  70. X  
  71. XYou're STILL (!) reading? Ok, now the features of the BBS. If you're missing
  72. Xa feature that is important for you, just talk to me. Maybe I've forgotten
  73. Xto mention it, or I'm able to offer it with the next patchlevel!
  74. X
  75. XThe BBS ...
  76. X
  77. X... uses NEWS to handle all boards/articles. You may use the BBS or your
  78. X    prevered newsreader to maintain the articles.
  79. X
  80. X... uses an internal mailer for mails between BBS-users.
  81. X
  82. X... uses (R/S)MAIL to receive/deliver mails from BBS-users to system-users
  83. X    of the same or foreigen sites and vice versa.
  84. X
  85. X... uses a variable command set. If you don't like the presetted commands,
  86. X    just change the config-file to have your own commands set.
  87. X
  88. X... commands are all fitted out with a user-level and a prototype-flag.
  89. X    You may have several commands with the same function, but only the
  90. X    commands with the prototype-flag set will be shown in the command-
  91. X    survey.
  92. X
  93. X... has "user defined commands". If you like to offer an external newsreader
  94. X    or mailer to your users, you only have to state that in a config-file.
  95. X
  96. X... is able to communicate in various languages. A german and an english
  97. X    language-file are delivered with this package. It takes about two or
  98. X    three hours to build language- and help-files for other countries.
  99. X
  100. X... offers PD-areas like all other boards. The trick is, that the articles
  101. X    in the PD-boards are including a pointer to the real PD-package. You
  102. X    are able to maintain that areas like all other boards. You don't have to
  103. X    copy your PD-directories!
  104. X   
  105. X... uses SX/SZ/SB and RX/RZ/RB as filetransfer protocols. Also ASCII up- 
  106. X    and download are available for text and PD transfer.
  107. X
  108. X... has it's own line-editor (B)LED. Users with higher level may use
  109. X    fullscreen-editors, of course. You only have to put all offered editors
  110. X    in a config-file.
  111. X
  112. X... even has it's on fullscreen (MIME) RTF-Editor. This one also handles
  113. X    8bit texts (like texts including 'umlauts' ;-)
  114. X
  115. X... NEWS&MAIL have a total 8bit-transparency. ISO 8859-1 and IBM-Keymaps are
  116. X    no longer a problem.
  117. X
  118. X... offers games to the users. Again, there's a config-file, which
  119. X    includes the list of your online-games (rogue/nethack etc.).
  120. X
  121. X... may call a CHAT-program. If you don't have one, please tell me. I've
  122. X    a PD-mutliport-chat program, too. Otherwise you can use TALK or
  123. X    phone as a two-person chat.
  124. X
  125. X... is able to read Bellcore RTF (Richtext Format) and Qouted-Printable.
  126. X
  127. X... creates MIME-Headers. This, and the RTF-feature are the first steps to
  128. X    multimedia-mail. 
  129. X
  130. X... allows to change the headerfield of news-articles and mails. (Depending
  131. X    on userlevel, of course!)
  132. X
  133. X... supports the (critical) header field "return-receipt-to:", to get an
  134. X    acknowledge for you sent mails and to confirm mails sent to mbox-users.
  135. X
  136. X... allows to reedit articles, if you are the autor. If you are the sysop,
  137. X    you may reedit everything ;-)
  138. X
  139. X... is able to generate statistics on calls, downloads, news-articles.
  140. X
  141. X... builds hitlists on calls per user, downloads per file, etc.
  142. X
  143. X... contains a users database with online-maintenance-facility.
  144. X
  145. X... allows users to setup the BBS to hit their preferences. They may
  146. X    choose:
  147. X
  148. X    - TERMINAL      ANSI X3.64, VT100, VT52, Dump (have a look at TERMCAP)
  149. X
  150. X    - EDITOR        VI, EMACS, PED, MINED, LED, WENDY (or whatever you offer)
  151. X
  152. X    - PROMPT        BOARD, TIME, RATES (with or w/o BELL)
  153. X
  154. X    - OUTPUT        TYPE, MORE, MORE with marks, direction, lines, etc. ...
  155. X
  156. X    - INTRO         INFOTEXT, STATE, both
  157. X       
  158. X    - SCANNER       DATE&TIME, DATE, change scanner date
  159. X
  160. X
  161. X... supports the following commands by default:
  162. X
  163. X    +, -, ACCOUNT, AREA, BOARD, CHAT, DIR, DATE, DELETE, DOWNLOAD, DIRECTION,
  164. X    DISUSSION, EDIT, FINGER, FORWARD, GAMES, GOODBYE, HELP, MAIL, MACRO, 
  165. X    MESSAGE, MINIX, PORTINFO, PROTOCOL, PM, READ, SETUP, SYSINFO, SIGNATURES,
  166. X    STATE, STATISTICS, SEARCH, TIME, USERS, UPLOAD, VERSION, WRITE
  167. X
  168. X    If you count the them and their various flags/options, you'll get a list
  169. X    of 102 commands. 
  170. END_OF_FILE
  171.   if test 5165 -ne `wc -c <'Announce10j7'`; then
  172.     echo shar: \"'Announce10j7'\" unpacked with wrong size!
  173.   fi
  174.   # end of 'Announce10j7'
  175. fi
  176. if test -f 'etc/english.shorth' -a "${1}" != "-c" ; then 
  177.   echo shar: Will not clobber existing file \"'etc/english.shorth'\"
  178. else
  179.   echo shar: Extracting \"'etc/english.shorth'\" \(4474 characters\)
  180.   sed "s/^X//" >'etc/english.shorth' <<'END_OF_FILE'
  181. X?                          reachable commands are shown 
  182. X? *                        all commands are shown
  183. Xcommand ?                  help on "command"
  184. X
  185. X0                          list command-buffers contents
  186. X1-9                        execute one of nine buffered commands 
  187. X
  188. X+                          go to the next board/group with NEW articles
  189. X
  190. X-                          go to the previous board/group with NEW articles
  191. X
  192. XACCOUNT               establish an account & a maildrop for a new user
  193. X
  194. XAREA +                     go to the next group of a subgroup
  195. XAREA ++                    go to the next group
  196. XAREA -                     go to a previous group of a subgroup
  197. XAREA --                    go to a previous group
  198. X
  199. XBOARD                      list boards with new articles
  200. XBOARD *                    list all boards depending on userlevel
  201. XBOARD **                   list ALL boards
  202. XBOARD +                    go to the next board
  203. XBOARD -                    go to the previous board
  204. XBOARD !                    display the name of the current board
  205. XBOARD #                    list areas in board
  206. XBOARD ..           step from one area to the previous one
  207. XBOARD boardname            jump to board "boardname"
  208. X
  209. XCHAT                       multiport chatsystem
  210. X
  211. XDATE               display current date
  212. X
  213. XDELETE article           delete article no. "article"
  214. XDELETE article-article       delete from "article" to "article"
  215. XDELETE >                   delete copies of your own mail in your PM
  216. X
  217. XDIR                        index new articles
  218. XDIR *                      index ALL articles (of a board)
  219. X
  220. XDIRECTION                  reading direction OLD <> NEW ?
  221. X
  222. XDISCUSSION *               in which discussions am I involved
  223. XDISCUSSION                 follow a subject thru the articles of a group
  224. X
  225. XDOWNLOAD                   receive a couple of articles under X-, Y-, Z-
  226. X                           or NONE-protocol 
  227. X
  228. XEDIT article               re-edit article no. "article"
  229. X
  230. XFINGER name                list infos about user "name"
  231. X
  232. XFORWARD                    list stored mails
  233. XFORWARD user               forward a stored mail to "user"
  234. XFORWARD article user       forward "article" to "user"
  235. X
  236. XGAMES               offer a (list of) game(s)
  237. X
  238. XGOODBYE               leave the BBS 
  239. X
  240. XHELP                       this shorthelp
  241. XHELP *                     display some pages of helpful descriptions
  242. XHELP command               show information on "command"
  243. X
  244. XMAIL user                  send mail to "user" 
  245. XMAIL host!user             send mail to "user" on system "host"
  246. XMAIL user@host.domain      send mail to "user" on system "host.domain"
  247. X
  248. XMACRO               display/declare macros
  249. X
  250. XMESSAGE                    show/change "hello" message
  251. X
  252. XMINIX OS-command           execute "OS-command" on MINIX-shell
  253. X
  254. XPORTINFO                   list all terminals, users, activities
  255. X
  256. XPROTOCOL                   protocol of all call(s/ers)
  257. XPROTOCOL *                 protocol (complete)
  258. XPROTOCOL #                 statistics of these calls
  259. XPROTOCOL %                 callers statistics (hitlist)
  260. X
  261. XPM                         move to your maildrop
  262. X
  263. XREAD                       read NEW articles
  264. XREAD *                     real ALL articles (of a board)
  265. XREAD article               show article no. "article"
  266. XREAD article-article       display from "article" to "article"
  267. X
  268. XSEARCH pattern             search for "pattern" in all articles of a group
  269. X
  270. XSETUP                      configure the BBS to your favor
  271. X
  272. XSIGNATURE           show/change your signature
  273. X
  274. XSTATE                      list your BBS-configuration
  275. X
  276. XSTATISTICS                 table containing NEWS-statistics
  277. XSTATISTICS *               table containing more NEWS-statistics
  278. XSTATISTICS $               UUCP-rates (only if UUCP supports this)
  279. XSTATISTICS #               download-statistics 
  280. XSTATISTICS %               download-statistics (hitlist)
  281. XSTATISTICS >               mailing-statistics (xmd)
  282. X
  283. XTIME                       local time and your online-time in seconds
  284. X
  285. XUSERS                      show users list
  286. XUSERS *                    show users list (more detailed)
  287. XUSERS #                    users up-/download ratio
  288. XUSERS %                    list users with their newsgroups
  289. XUSERS $                    accounting information (payload ;-)
  290. XUSERS name                 list infos about user "name"
  291. X
  292. XVERSION                    print version
  293. XVERSION *                  display compiling definitions
  294. XVERSION #                  the "Hall of Fame"
  295. X
  296. XWRITE                      create a new article and post it 
  297. END_OF_FILE
  298.   if test 4474 -ne `wc -c <'etc/english.shorth'`; then
  299.     echo shar: \"'etc/english.shorth'\" unpacked with wrong size!
  300.   fi
  301.   # end of 'etc/english.shorth'
  302. fi
  303. if test -f 'src/ctrlx.c' -a "${1}" != "-c" ; then 
  304.   echo shar: Will not clobber existing file \"'src/ctrlx.c'\"
  305. else
  306.   echo shar: Extracting \"'src/ctrlx.c'\" \(2125 characters\)
  307.   sed "s/^X//" >'src/ctrlx.c' <<'END_OF_FILE'
  308. X/***************************************************************************/
  309. X/*        PROGRAMM  ix/Mbox                           */
  310. X/*             DATEI  ctrlx.c                           */
  311. X/*        FUNKTIONEN  ctrlx(), noctrlx()                   */
  312. X/*             AUTOR  vs (Volker Schuermann/MINIX-Version)           */
  313. X/*  LETZTE AENDERUNG  16.11.1991                       */
  314. X/***************************************************************************/
  315. X
  316. X#ifdef _SYS7    /* UNIX System 7  (MINIX, COHERENT, ...) */
  317. X
  318. X#include  <sgtty.h>
  319. Xstatic struct tchars newtc, oldtc;
  320. X
  321. X#else        /* UNIX System V  (UNIX, XENIX, ESIX, ...) */
  322. X
  323. X#ifdef _LINUX
  324. X#include  <termio.h>
  325. X#else
  326. X#include  <sys/termio.h> 
  327. X#endif
  328. Xstatic struct termio newtc, oldtc;
  329. X
  330. X#endif
  331. X
  332. X
  333. X
  334. X
  335. X/***************************************************************************/
  336. X/*      FUNKTION  ctrlx()                           */
  337. X/*  BESCHREIBUNG  Das QUIT-Zeichen wird auf (int) 24 gesetzt - das ent-       */
  338. X/*          spricht einem CTRL-X. Wird nun CTRL-X gedrueckt, loest   */
  339. X/*          UNIX das Signal SIGABRT aus ...                          */
  340. X/*     PARAMETER  keine                                                       */
  341. X/*     RUECKGABE  keine                                                    */
  342. X/***************************************************************************/
  343. X
  344. Xvoid ctrlx()
  345. X{
  346. X
  347. X#ifdef _SYS7
  348. X
  349. X  ioctl(0, TIOCGETC, (struct sgttyb *) &oldtc);
  350. X  newtc = oldtc;
  351. X  newtc.t_quitc = 24;
  352. X  ioctl(0, TIOCSETC, (struct sgttyb *) &newtc);
  353. X
  354. X#else
  355. X
  356. X  ioctl(0, TCGETA, (struct termio *) &oldtc);
  357. X  newtc = oldtc;
  358. X  newtc.c_cc[VQUIT] = 24;
  359. X  ioctl(0, TCSETA, (struct termio *) &newtc);
  360. X
  361. X#endif
  362. X
  363. X}
  364. X
  365. X
  366. X/***************************************************************************/
  367. X/*      FUNKTION  noctrlx()                           */
  368. X/*  BESCHREIBUNG  Das QUIT-Zeichen wird "restauriert" ...           */
  369. X/*     PARAMETER  keine                                                       */
  370. X/*     RUECKGABE  keine                                                    */
  371. X/***************************************************************************/
  372. X
  373. Xvoid noctrlx()
  374. X{
  375. X
  376. X#ifdef _SYS7
  377. X
  378. X  ioctl(0, TIOCSETC, (struct sgttyb *) &oldtc);
  379. X
  380. X#else
  381. X
  382. X  ioctl(0, TCSETA, (struct termio *) &oldtc);
  383. X
  384. X#endif
  385. X
  386. X}
  387. END_OF_FILE
  388.   if test 2125 -ne `wc -c <'src/ctrlx.c'`; then
  389.     echo shar: \"'src/ctrlx.c'\" unpacked with wrong size!
  390.   fi
  391.   # end of 'src/ctrlx.c'
  392. fi
  393. if test -f 'src/defs.h' -a "${1}" != "-c" ; then 
  394.   echo shar: Will not clobber existing file \"'src/defs.h'\"
  395. else
  396.   echo shar: Extracting \"'src/defs.h'\" \(3711 characters\)
  397.   sed "s/^X//" >'src/defs.h' <<'END_OF_FILE'
  398. X/***************************************************************************/
  399. X/* Was jetzt folgt, ist fuer Experimente voellig ungeeignet. Jegliche Aen- */
  400. X/* derung bringt ueber kurz oder lang ernste Probleme fuer die Konsistenz  */
  401. X/* der ix/MBox.                                        */
  402. X/*                                       */
  403. X/* Auch wenn Aenderungen (zufaellig) erfolgreich sein sollten, duerfen sie */
  404. X/* nicht an dritte weitergeleitet werden.                   */
  405. X/*                                       */
  406. X/* Wer globale Variablen/Strukturen nicht akzeptiert, sollte jetzt auf der */
  407. X/* Stelle diese Datei verlassen !                       */
  408. X/***************************************************************************/
  409. X
  410. X  
  411. X#ifndef EXTERN
  412. X#define EXTERN extern
  413. X#endif
  414. X
  415. X/* --------------------------- HAENDE WEG !!! ---------------------------- */
  416. X
  417. X#include "proto.h"
  418. X
  419. X#define STRING         81
  420. X#define LSTRING         STRING + 4
  421. X#define LONGSTRING  256
  422. X#define BS            8
  423. X#define CR           13
  424. X#define LF           10
  425. X#define TAB           9
  426. X#define BELL          7
  427. X#define DEL         127
  428. X#define CTRL_X         24
  429. X#define CTRL_Z       26
  430. X#define CTRL_D        4
  431. X#define ESC          27
  432. X
  433. X#if defined( _SYS7) || defined(_SCO)
  434. X#define ENTER        13
  435. X#else
  436. X#define ENTER        10
  437. X#endif
  438. X
  439. X
  440. X#define fix( II )  ( II / 100 )
  441. X#define flt( II )  ( II - (fix( II ) * 100 ))
  442. X
  443. X#define MAKRO_MAX_REK 30
  444. X
  445. X#define DEF_MAX_SCR_LINES 23
  446. X
  447. XEXTERN int MAX_SCR_LINES;
  448. X
  449. XEXTERN int OLDUID;
  450. XEXTERN int OLDGID;
  451. X
  452. XEXTERN unsigned char PROMPT[STRING];
  453. XEXTERN unsigned char TERMINAL[STRING];
  454. X
  455. XEXTERN unsigned char EDDY[STRING];
  456. X
  457. XEXTERN unsigned char BRETT[STRING];
  458. XEXTERN unsigned char INHALT[STRING];
  459. XEXTERN unsigned char NG[STRING];
  460. X
  461. XEXTERN unsigned char UGROUPS[STRING];
  462. XEXTERN unsigned char MAKRO[STRING];
  463. X
  464. XEXTERN unsigned char MYNAME[STRING];
  465. X
  466. XEXTERN long LASTLOG;
  467. XEXTERN int LASTTIME;
  468. X
  469. XEXTERN int IS_BUFFERED;
  470. X
  471. XEXTERN int SHORT_HEADER;
  472. X
  473. XEXTERN long IDX_SIZE;
  474. X
  475. XEXTERN struct userdaten {
  476. X    int id;
  477. X    unsigned char name[31];
  478. X    unsigned char passwort[11];
  479. X    unsigned char sh_name[15];
  480. X    unsigned char nick[31];
  481. X    unsigned char wohnort[31];
  482. X    unsigned char strasse[31];
  483. X    unsigned char telefon1[31];
  484. X    unsigned char telefon2[31];
  485. X    unsigned char geburtsdatum[31];
  486. X        int terminal;
  487. X    int editor;
  488. X    int level;
  489. X        int bell;
  490. X    int prompt;
  491. X    int more;
  492. X    unsigned char lastlog[11]; 
  493. X    int seq;
  494. X        int intro;
  495. X    int lasttime;
  496. X     int lastmode;
  497. X    int leserichtung;
  498. X    int tlines;
  499. X    long upratio;
  500. X    long downratio;
  501. X    long elapsed;
  502. X    unsigned char newsgrps[STRING];
  503. X    unsigned char schluessel[STRING];
  504. X    unsigned char abused[STRING];
  505. X    unsigned char account[STRING];         
  506. X} USER;
  507. X
  508. X
  509. X
  510. X#define MAX_BEF 80
  511. X
  512. XEXTERN struct bef_struct {
  513. X    int id;
  514. X    int in;
  515. X     int ex;
  516. X    int prototyp;
  517. X    unsigned char befehl[(STRING/2)];
  518. X    unsigned char pfad[STRING];
  519. X} BEF[MAX_BEF];
  520. X
  521. X
  522. X#define MAX_MAK 30
  523. X
  524. XEXTERN struct mak_struct {
  525. X    unsigned char makname[STRING];
  526. X    unsigned char makwert[(STRING * 2)];
  527. X} MAK[MAX_MAK];
  528. X
  529. X
  530. X
  531. X#define MAX_NEWSGRPS 20
  532. X
  533. XEXTERN unsigned char newsgrp[MAX_NEWSGRPS][(STRING/3)];
  534. XEXTERN int newsgrpptr;
  535. X
  536. XEXTERN int MAILOUT_LEV;
  537. XEXTERN int ADMIN_LEV;
  538. XEXTERN int WRITE_EX_LEV;
  539. XEXTERN int WRITE_IN_LEV;
  540. XEXTERN int WRITE_INTERNAT;
  541. XEXTERN int PD_D_LEV;
  542. XEXTERN int PD_U_LEV;
  543. XEXTERN int EXE_LEV; 
  544. XEXTERN int GUEST_LEV;
  545. X
  546. XEXTERN unsigned char CONSOLE_REDIRECT[STRING];
  547. X
  548. XEXTERN int BB1;
  549. XEXTERN int BB2;
  550. XEXTERN int BB3;
  551. XEXTERN int BB4;
  552. XEXTERN int BB5;
  553. XEXTERN int BB6;
  554. XEXTERN int BB7;
  555. XEXTERN int BB8;
  556. XEXTERN int BB9;
  557. X
  558. XEXTERN unsigned char UUCPID[STRING];
  559. X
  560. XEXTERN int BAUDRATE;
  561. X
  562. XEXTERN int UMLAUT;
  563. X
  564. XEXTERN int UMLAUT_MODUS;
  565. X
  566. XEXTERN int fetch_local;
  567. XEXTERN unsigned char fetch_subj[STRING];
  568. X
  569. XEXTERN int DISKUSSION;
  570. XEXTERN unsigned char DIS_subject[STRING];
  571. X
  572. XEXTERN int OFFERED_EDITORS;
  573. X
  574. X/* --------------------------- HAENDE WEG !!! ---------------------------- */
  575. X
  576. X
  577. X
  578. X
  579. X
  580. X
  581. X
  582. X
  583. END_OF_FILE
  584.   if test 3711 -ne `wc -c <'src/defs.h'`; then
  585.     echo shar: \"'src/defs.h'\" unpacked with wrong size!
  586.   fi
  587.   # end of 'src/defs.h'
  588. fi
  589. if test -f 'src/faces.c' -a "${1}" != "-c" ; then 
  590.   echo shar: Will not clobber existing file \"'src/faces.c'\"
  591. else
  592.   echo shar: Extracting \"'src/faces.c'\" \(3576 characters\)
  593.   sed "s/^X//" >'src/faces.c' <<'END_OF_FILE'
  594. X/***************************************************************************/
  595. X/*        PROGRAMM  ix/Mbox                           */
  596. X/*             DATEI  faces.c                           */
  597. X/*        FUNKTIONEN  faces()                           */
  598. X/*             AUTOR  vs (Volker Schuermann/MINIX-Version)           */
  599. X/*  LETZTE AENDERUNG  08.06.1992                       */
  600. X/***************************************************************************/
  601. X
  602. X#include <stdio.h>
  603. X
  604. X#include "mbox.h"
  605. X
  606. X/* There were plans to implement the X-Face: Headlines, but the resulting
  607. X   overhead is much too big, to realize it! */
  608. X
  609. X
  610. X#define a1    219
  611. X#define a2    223
  612. X#define a3    220
  613. X#define a4    32
  614. X
  615. X#define b1    '8'
  616. X#define b2    '9'
  617. X#define b3    '6'
  618. X#define b4    32
  619. X
  620. X
  621. Xvoid faces( fname )
  622. Xunsigned char fname[];
  623. X{
  624. X  int x, y;
  625. X  int x1, y1;
  626. X  int Z1, Z2, Z3, Z4;
  627. X  FILE *fp;
  628. X  int c, i;
  629. X  unsigned char s[STRING];
  630. X  int tog = 0;
  631. X  unsigned char t[STRING];
  632. X
  633. X
  634. X
  635. X  ansi("mr");
  636. X  printf("[Bild des Autors ansehen?] G, A, %c, ? > ", GBL07_MSG);
  637. X  ansi("me");
  638. X  printf("G%c", BS);
  639. X
  640. X  do {
  641. X    c = getint();
  642. X    if (c >= 97) c -= 32;
  643. X    if (c == ENTER) c = 'G';
  644. X    if (c == '?') {
  645. X        clearline();
  646. X        ansi("mr");
  647. X        printf("%c%s > ", CR, "Bild des Autors anzeigen als Grafik, Ascii-Bild oder lieber Nicht ?");
  648. X        ansi("me");
  649. X    }
  650. X    if ((c != 'G') && (c != 'A') && (c != GBL07_MSG)) c = 0;
  651. X  } while (c == 0);
  652. X
  653. X  printf("%c\n\n", c);
  654. X
  655. X  if (c == GBL07_MSG) return;
  656. X
  657. X  if(c == 'G'){
  658. X    Z1 = a1;
  659. X    Z2 = a2;
  660. X    Z3 = a3;
  661. X    Z4 = a4;
  662. X  }
  663. X  if(c == 'A'){
  664. X    Z1 = b1;
  665. X    Z2 = b2;
  666. X    Z3 = b3;
  667. X    Z4 = b4;
  668. X  }
  669. X
  670. X  sprintf(s, "%s/etc/face.put", HOME);
  671. X
  672. X  fp = fopen( s, "r" );
  673. X  
  674. X  x1 = fgetc(fp); c = fgetc(fp);
  675. X  y1 = fgetc(fp); c = fgetc(fp);
  676. X
  677. X  for(y = 0; y < y1; y++){
  678. X    i = 0;
  679. X    for(x = 0; x < x1; x += 8){
  680. X        c = fgetc(fp);
  681. X        if(tog == 0) s[i] = c;
  682. X        else t[i] = c;
  683. X        i++;
  684. X    }
  685. X    tog++;
  686. X    if(tog == 2){
  687. X        tog = 0;
  688. X        i = (int) x/8;
  689. X        for(x = 0; x < i; x ++){
  690. X            if( (s[x] & 128) &&  (t[x] & 128)) printf("%c", Z1);
  691. X            if( (s[x] & 128) && !(t[x] & 128)) printf("%c", Z2);
  692. X            if(!(s[x] & 128) &&  (t[x] & 128)) printf("%c", Z3);
  693. X            if(!(s[x] & 128) && !(t[x] & 128)) printf("%c", Z4);
  694. X
  695. X            if( (s[x] & 64) &&  (t[x] & 64)) printf("%c", Z1);
  696. X            if( (s[x] & 64) && !(t[x] & 64)) printf("%c", Z2);
  697. X            if(!(s[x] & 64) &&  (t[x] & 64)) printf("%c", Z3);
  698. X            if(!(s[x] & 64) && !(t[x] & 64)) printf("%c", Z4);
  699. X
  700. X            if( (s[x] & 32) &&  (t[x] & 32)) printf("%c", Z1);
  701. X            if( (s[x] & 32) && !(t[x] & 32)) printf("%c", Z2);
  702. X            if(!(s[x] & 32) &&  (t[x] & 32)) printf("%c", Z3);
  703. X            if(!(s[x] & 32) && !(t[x] & 32)) printf("%c", Z4);
  704. X
  705. X            if( (s[x] & 16) &&  (t[x] & 16)) printf("%c", Z1);
  706. X            if( (s[x] & 16) && !(t[x] & 16)) printf("%c", Z2);
  707. X            if(!(s[x] & 16) &&  (t[x] & 16)) printf("%c", Z3);
  708. X            if(!(s[x] & 16) && !(t[x] & 16)) printf("%c", Z4);
  709. X
  710. X            if( (s[x] & 8) &&  (t[x] & 8)) printf("%c", Z1);
  711. X            if( (s[x] & 8) && !(t[x] & 8)) printf("%c", Z2);
  712. X            if(!(s[x] & 8) &&  (t[x] & 8)) printf("%c", Z3);
  713. X            if(!(s[x] & 8) && !(t[x] & 8)) printf("%c", Z4);
  714. X
  715. X            if( (s[x] & 4) &&  (t[x] & 4)) printf("%c", Z1);
  716. X            if( (s[x] & 4) && !(t[x] & 4)) printf("%c", Z2);
  717. X            if(!(s[x] & 4) &&  (t[x] & 4)) printf("%c", Z3);
  718. X            if(!(s[x] & 4) && !(t[x] & 4)) printf("%c", Z4);
  719. X
  720. X            if( (s[x] & 2) &&  (t[x] & 2)) printf("%c", Z1);
  721. X            if( (s[x] & 2) && !(t[x] & 2)) printf("%c", Z2);
  722. X            if(!(s[x] & 2) &&  (t[x] & 2)) printf("%c", Z3);
  723. X            if(!(s[x] & 2) && !(t[x] & 2)) printf("%c", Z4);
  724. X
  725. X            if( (s[x] & 1) &&  (t[x] & 1)) printf("%c", Z1);
  726. X            if( (s[x] & 1) && !(t[x] & 1)) printf("%c", Z2);
  727. X            if(!(s[x] & 1) &&  (t[x] & 1)) printf("%c", Z3);
  728. X            if(!(s[x] & 1) && !(t[x] & 1)) printf("%c", Z4);
  729. X        }
  730. X        printf("\n");
  731. X    }
  732. X  }
  733. X  fclose(fp);
  734. X
  735. X  c = getint();
  736. X}
  737. X
  738. X
  739. X
  740. END_OF_FILE
  741.   if test 3576 -ne `wc -c <'src/faces.c'`; then
  742.     echo shar: \"'src/faces.c'\" unpacked with wrong size!
  743.   fi
  744.   # end of 'src/faces.c'
  745. fi
  746. if test -f 'src/suchen.c' -a "${1}" != "-c" ; then 
  747.   echo shar: Will not clobber existing file \"'src/suchen.c'\"
  748. else
  749.   echo shar: Extracting \"'src/suchen.c'\" \(4792 characters\)
  750.   sed "s/^X//" >'src/suchen.c' <<'END_OF_FILE'
  751. X/***************************************************************************/
  752. X/*        PROGRAMM  ix/Mbox                           */
  753. X/*             DATEI  suchen.c                           */
  754. X/*        FUNKTIONEN  suchen(), edit()                       */
  755. X/*             AUTOR  vs (Volker Schuermann/MINIX-Version)           */
  756. X/*  LETZTE AENDERUNG  13.06.1992                       */
  757. X/***************************************************************************/
  758. X
  759. X#include <stdio.h>
  760. X#include <signal.h>
  761. X
  762. X#include "mbox.h"
  763. X
  764. X
  765. X/***************************************************************************/
  766. X/*      FUNKTION  suchen()                           */
  767. X/*  BESCHREIBUNG  Artikel im aktuellen Brett mit GREP nach muster durch-   */
  768. X/*           suchen und entsprechende Artikel anzeigen.           */
  769. X/*     PARAMETER  muster = Suchbegriff                           */
  770. X/*     RUECKGABE  keine                                                    */
  771. X/***************************************************************************/
  772. X
  773. Xvoid suchen( muster )
  774. Xunsigned char muster[];
  775. X{
  776. X  FILE *fp;
  777. X
  778. X  unsigned char s[STRING];
  779. X  unsigned char t[STRING];
  780. X  unsigned char tmp[STRING];
  781. X  unsigned char ex[LONGSTRING];
  782. X
  783. X  int fpid;
  784. X  int found = 0;
  785. X  int ok = 0;
  786. X  int i;
  787. X  
  788. X
  789. X  if(muster[0] == '\0'){
  790. X    ansi( "md" );
  791. X    printf("\n\n%s ", SUC01_MSG);
  792. X    ansi( "me" );
  793. X    strcpy(muster, (unsigned char *) getline(60, 1, 32, ""));
  794. X    if(muster[0] == '\0'){
  795. X        printf(" <- %s\n", SUC02_MSG);
  796. X        return;
  797. X    }
  798. X  }
  799. X
  800. X  i = 0;
  801. X  while(muster[i] != '\0'){
  802. X    if(muster[i] == '"') muster[i] = ' ';
  803. X    i++;
  804. X  }
  805. X
  806. X  sprintf(s, " %s \"%s\" %s [%s] ", SUC03_MSG, (unsigned char *) stripped(muster), SUC04_MSG, NG);
  807. X  headline( s );
  808. X
  809. X  printf("%s .", SUC05_MSG);
  810. X
  811. X  sprintf(tmp, "%s/such.%d", TMP, getpid());
  812. X
  813. X  if(strcomp("PM", BRETT) == 0){
  814. X    sprintf(t, "%s/usr/%d", HOME, USER.id);
  815. X    chdir( t );
  816. X  }
  817. X  else{
  818. X    chdir( BRETT );
  819. X  }
  820. X
  821. X  switch( (fpid = fork()) ){
  822. X        case -1 :
  823. X                break;
  824. X        case  0 :    while(1){
  825. X                    printf(".");
  826. X                    sleep(3);
  827. X                }    
  828. X                break;
  829. X  }
  830. X
  831. X  sprintf(s, "%s \"%s\" * > %s 2> %s", GREP, (unsigned char *) stripped(muster), tmp, CPRN);
  832. X  system( s );
  833. X
  834. X  kill( fpid, SIGKILL );
  835. X  (void) wait( &fpid );
  836. X
  837. X  printf("%c", CR);
  838. X
  839. X
  840. X  fp = fopen( tmp, "r" );
  841. X  if(fp == 0){
  842. X    
  843. X  }
  844. X  while((fgets(ex, LONGSTRING, fp) != NULL) && (ok == 0)){
  845. X    if(atoi(ex) != 0){    
  846. X        if(show( (unsigned char *) stripped(ex), 9999, USER.more ) == -1) ok++;
  847. X        found++;
  848. X    }
  849. X  }
  850. X  fclose(fp);
  851. X
  852. X  chdir( HOME );
  853. X
  854. X  if(found == 0){
  855. X    printf("%s \"%s\" %s\n", SUC06_MSG, (unsigned char *) stripped(muster), SUC07_MSG);
  856. X  }
  857. X
  858. X  unlink( tmp );
  859. X}
  860. X
  861. X
  862. X/***************************************************************************/
  863. X/*      FUNKTION  edit()                           */
  864. X/*  BESCHREIBUNG                                 */
  865. X/*     PARAMETER                                     */
  866. X/*     RUECKGABE  keine                                                    */
  867. X/***************************************************************************/
  868. X
  869. Xvoid edit( arg )
  870. Xunsigned char arg[];
  871. X{
  872. X  FILE *fp;
  873. X  FILE *ff;
  874. X
  875. X  unsigned char s[STRING];
  876. X  unsigned char t[STRING];
  877. X  unsigned char d[STRING];
  878. X  unsigned char p1[STRING];
  879. X  unsigned char p2[STRING];
  880. X
  881. X  int ok = 0;
  882. X  int yet = 0;
  883. X
  884. X  if (arg[0] == '\0') {
  885. X    ansi( "md" );
  886. X    printf(" <- %s\n", SUC07aMSG);
  887. X    ansi( "me" ); 
  888. X    return;
  889. X  }
  890. X
  891. X  if (strcomp(BRETT, "PM") != 0) {
  892. X        sprintf(t, "%s/%s", BRETT, arg); 
  893. X  }
  894. X  else {
  895. X    sprintf(t, "%s/usr/%d/%s", HOME, USER.id, arg);
  896. X    /*
  897. X    ansi( "md" );
  898. X    printf(" <- %s\n", SUC08_MSG);
  899. X    ansi( "me" ); 
  900. X    return;
  901. X    */
  902. X  }
  903. X  
  904. X  if((USER.level < ADMIN_LEV) && (USER.level >= EXE_LEV)){
  905. X     fp = fopen( t, "r" );
  906. X    if(fp == NULL){
  907. X        ansi( "md" );
  908. X        printf(" <- %s\n", SUC10_MSG);
  909. X        ansi( "me" ); 
  910. X        return;
  911. X    }
  912. X    while((fgets(s, 80, fp) != 0) && (ok == 0)){
  913. X        if(strcomp("From: ", s) == 0){
  914. X            strcpy(d, (unsigned char *) strcopy(s, 6, 80));
  915. X            if(strcomp(USER.name, d) == 0) ok++;
  916. X        }
  917. X    }
  918. X    fclose(fp);
  919. X    if(ok == 0){
  920. X        ansi( "md" );
  921. X        printf(" <- %s\n", SUC09_MSG);
  922. X        ansi( "me" ); 
  923. X        return;
  924. X    }
  925. X  }
  926. X
  927. X  if(USER.level >= EXE_LEV){
  928. X    sprintf(s, "%s %s", EDDY, t);
  929. X    noctrlx();
  930. X    system(s);
  931. X    ctrlx();
  932. X  }
  933. X  else{
  934. X    sprintf(p1, "%s/%dED1", TMP, getpid());
  935. X    sprintf(p2, "%s/%dED2", TMP, getpid());
  936. X
  937. X    fp = fopen( t, "r" );
  938. X    if(fp == NULL){
  939. X        ansi( "md" );
  940. X        printf(" <- %s\n", SUC08_MSG);
  941. X        ansi( "me" ); 
  942. X        return;
  943. X    }
  944. X     ff = fopen( p1, "w" );
  945. X    while(fgets(s, 80, fp) != NULL){
  946. X        fputs(s, ff);
  947. X        if(strcomp("From: ", s) == 0){
  948. X            strcpy(d, (unsigned char *) strcopy(s, 6, 80));
  949. X            if(strcomp(USER.name, d) == 0) ok++;
  950. X        }
  951. X        if((strlen(s) < 3) && (yet == 0)){
  952. X            fclose(ff);
  953. X            ff = fopen( p2, "w" );
  954. X            yet++;
  955. X        }
  956. X    }
  957. X    fclose(fp);
  958. X    fclose(ff);
  959. X
  960. X    if(ok == 0){
  961. X        ansi( "md" );
  962. X        printf(" <- %s\n", SUC09_MSG);
  963. X        ansi( "me" ); 
  964. X        unlink( p1 );
  965. X        unlink( p2 );
  966. X        return;
  967. X    }
  968. X
  969. X    sprintf(s, "%s %s", EDDY, p2);
  970. X    noctrlx();
  971. X    system(s);
  972. X    ctrlx();
  973. X
  974. X    sprintf(s, "cat %s > %s", p1, t);
  975. X    system( s );
  976. X    sprintf(s, "cat %s >> %s", p2, t);
  977. X    system( s );
  978. X
  979. X    unlink( p1 );
  980. X    unlink( p2 );
  981. X  }
  982. X}
  983. END_OF_FILE
  984.   if test 4792 -ne `wc -c <'src/suchen.c'`; then
  985.     echo shar: \"'src/suchen.c'\" unpacked with wrong size!
  986.   fi
  987.   # end of 'src/suchen.c'
  988. fi
  989. if test -f 'src/weiterl.c' -a "${1}" != "-c" ; then 
  990.   echo shar: Will not clobber existing file \"'src/weiterl.c'\"
  991. else
  992.   echo shar: Extracting \"'src/weiterl.c'\" \(3768 characters\)
  993.   sed "s/^X//" >'src/weiterl.c' <<'END_OF_FILE'
  994. X/***************************************************************************/
  995. X/*        PROGRAMM  ix/Mbox                           */
  996. X/*             DATEI  weiterleiten.c                       */
  997. X/*        FUNKTIONEN  weiterleiten(), carboncopy()               */
  998. X/*             AUTOR  vs (Volker Schuermann/MINIX-Version)           */
  999. X/*  LETZTE AENDERUNG  05.07.1992                       */
  1000. X/***************************************************************************/
  1001. X
  1002. X#include <stdio.h>
  1003. X
  1004. X#include "mbox.h"
  1005. X
  1006. X
  1007. X/***************************************************************************/
  1008. X/*      FUNKTION  weiterleiten()                       */
  1009. X/*  BESCHREIBUNG  Je nach Parameter wird entweder ein Artikel an einen     */
  1010. X/*          User weitergeleitet, oder aber die letzte PM nochmal     */
  1011. X/*          mit einer anderen Adresse verschickt.                    */
  1012. X/*     PARAMETER  arg = Nummer des Artikel, Empfaenger, etc.               */
  1013. X/*     RUECKGABE  keine                                                    */
  1014. X/***************************************************************************/
  1015. X
  1016. Xvoid weiterleiten( arg )
  1017. Xunsigned char arg[];
  1018. X{
  1019. X  FILE *fp;
  1020. X  unsigned char s[STRING];
  1021. X  unsigned char t[STRING];
  1022. X  unsigned char subject[STRING];
  1023. X  int i, a, num;
  1024. X  unsigned char empf[STRING];
  1025. X
  1026. X  subject[0] = '\0';
  1027. X
  1028. X  sprintf(s, "%s/usr/%d/.lastsubject", HOME, USER.id);
  1029. X  fp = fopen( s, "r" );
  1030. X  if(fp != NULL){
  1031. X    fgets(subject, 80, fp);
  1032. X    fclose(fp);
  1033. X  }
  1034. X
  1035. X  if((subject[0] == '\0') && ((arg[0] > 64) || (arg[0] == '?'))){
  1036. X    ansi("md", 0, 0);
  1037. X    printf(" %s\n", WEI01_MSG);
  1038. X    ansi("me", 0, 0);
  1039. X    return;
  1040. X  }
  1041. X
  1042. X  if(arg[0] == '\0'){
  1043. X    printf("\n\n%s\n\n", WEI02_MSG);
  1044. X    ansi("md", 0, 0);
  1045. X    printf("%s %s\n\n", WEI03_MSG, subject);
  1046. X    ansi("me", 0, 0);
  1047. X    return;
  1048. X  }
  1049. X
  1050. X  num = 0;
  1051. X
  1052. X  if(arg[0] < 65){
  1053. X    i = 0;
  1054. X    while((arg[i] > 32) && (arg[i] != '\0')) i++;
  1055. X    strcpy(s, (unsigned char *) strcopy(arg, 0, (i-1)));
  1056. X    num = atoi(s);
  1057. X    strcpy(empf, (unsigned char *) strcopy(arg, (i+1), length(arg)));
  1058. X    strcat(empf, "$");
  1059. X  }
  1060. X  else{
  1061. X    sprintf(empf, "%s$", arg);
  1062. X  }  
  1063. X
  1064. X  if(num != 0){
  1065. X    if(strcomp(BRETT, "PM") != 0){
  1066. X        sprintf(t, "%s/%d", BRETT, num);
  1067. X        sprintf(s, "cp %s/%d %s/usr/%d/.lastletter", BRETT, num, HOME, USER.id);
  1068. X    }
  1069. X    else{
  1070. X        sprintf(t, "%s/usr/%d/%d", HOME, USER.id, num);
  1071. X        sprintf(s, "cp %s/usr/%d/%d %s/usr/%d/.lastletter", HOME, USER.id, num, HOME, USER.id);
  1072. X    }
  1073. X    fp = fopen( t, "r" );
  1074. X    if(fp == NULL){
  1075. X        ansi("md", 0, 0);
  1076. X        printf(" %s\n", WEI04_MSG);
  1077. X        ansi("me", 0, 0);
  1078. X    return;
  1079. X    }
  1080. X    fclose(fp);
  1081. X    system(s);
  1082. X    sprintf(s, "%s/usr/%d/.lastletter", HOME, USER.id);
  1083. X
  1084. X    sprintf(s, "%s/usr/%d/.lastsubject", HOME, USER.id);
  1085. X    fp = fopen( s, "w" );
  1086. X    if(fp == NULL){
  1087. X        nerror("weiterl.c", 76, "weiterleiten", "Datei_Schreibfehler", s);
  1088. X    }
  1089. X    fprintf(fp, "%d <%s>", num, NG);
  1090. X    fclose(fp);
  1091. X  }
  1092. X
  1093. X  brief(empf);
  1094. X}
  1095. X
  1096. X
  1097. X/***************************************************************************/
  1098. X/*      FUNKTION  carboncopy()                           */
  1099. X/*  BESCHREIBUNG  Kopien einer MAIL an mehrer Empfaenger versenden       */
  1100. X/*     PARAMETER  cc  = Empfaenger einer Kopie (im Header sichtbar)       */
  1101. X/*          bcc = Empfaenger einer Kopie (im Header unsichtbar)       */
  1102. X/*     RUECKGABE  keine                                                    */
  1103. X/***************************************************************************/
  1104. X
  1105. Xvoid carboncopy( cc, bcc )
  1106. Xunsigned char cc[], bcc[];
  1107. X{
  1108. X  unsigned char ex[LONGSTRING];
  1109. X  unsigned char ef[LONGSTRING];
  1110. X  unsigned char s[STRING];
  1111. X
  1112. X  int a = 0, i = 0;
  1113. X  int ok = 0;
  1114. X
  1115. X  printf("\n");
  1116. X
  1117. X  sprintf(ex, "%s,%s ", (unsigned char *) stripped(cc), bcc);
  1118. X
  1119. X  if(ex[0] == '\0') return;
  1120. X
  1121. X  while(ok == 0){
  1122. X    while((ex[i] != ',') && (ex[i] != '\0')) i++;
  1123. X
  1124. X    if(ex[i] == '\0') ok++;
  1125. X
  1126. X    strcpy(ef, (unsigned char *) bigcopy(ex, a, (i-1)));
  1127. X    strcpy(s, (unsigned char *) stripped(ef));
  1128. X
  1129. X    if((strlen(s) > 1) && (s[0] != '(')){
  1130. X        weiterleiten( s );
  1131. X    }
  1132. X    a = i + 1;
  1133. X    i++;
  1134. X  }
  1135. X  
  1136. X}
  1137. END_OF_FILE
  1138.   if test 3768 -ne `wc -c <'src/weiterl.c'`; then
  1139.     echo shar: \"'src/weiterl.c'\" unpacked with wrong size!
  1140.   fi
  1141.   # end of 'src/weiterl.c'
  1142. fi
  1143. if test -f 'wendy/block.c' -a "${1}" != "-c" ; then 
  1144.   echo shar: Will not clobber existing file \"'wendy/block.c'\"
  1145. else
  1146.   echo shar: Extracting \"'wendy/block.c'\" \(5294 characters\)
  1147.   sed "s/^X//" >'wendy/block.c' <<'END_OF_FILE'
  1148. X#include "wendy.h"
  1149. X
  1150. X
  1151. X/*    Block markieren        */
  1152. X
  1153. Xblock_set()
  1154. X{
  1155. X  int xa, ya;
  1156. X
  1157. X  if((BLOCK.status == 0) || (BLOCK.status == BLOCKMODE)){
  1158. X    BLOCK.status = 1;
  1159. X    BLOCK.x1     = x;
  1160. X    BLOCK.y1     = (ypos + y) -1;
  1161. X    BLOCK.ypos   = ypos;
  1162. X    BLOCK.y         = y;
  1163. X#ifdef _LOCAL
  1164. X    show_status( " WENDY: Blockanfang markiert. " );
  1165. X#else
  1166. X    show_status( " WENDY: Begin of block marked. " );
  1167. X#endif
  1168. X  }
  1169. X  else{
  1170. X    if(BLOCK.status == 1){
  1171. X        BLOCK.status = BLOCKMODE;
  1172. X        BLOCK.x2 = x;
  1173. X        BLOCK.y2 = (ypos + y) -1;
  1174. X
  1175. X        if((BLOCK.y1 == BLOCK.y2) && (BLOCK.x1 == BLOCK.x2)){
  1176. X            printf("%c", 7);
  1177. X#ifdef _LOCAL
  1178. X            show_status( " WENDY: Hae? " );
  1179. X#else        
  1180. X            show_status( " WENDE: So what? ");
  1181. X#endif
  1182. X            BLOCK.status = 0;
  1183. X        }
  1184. X        else{
  1185. X            if(BLOCK.y1 > BLOCK.y2){
  1186. X                ya = BLOCK.y1;
  1187. X                xa = BLOCK.x1;
  1188. X                BLOCK.y1 = BLOCK.y2;
  1189. X                BLOCK.x1 = BLOCK.x2;
  1190. X                BLOCK.y2 = ya;
  1191. X                BLOCK.x2 = xa;
  1192. X            }
  1193. X
  1194. X            if(BLOCK.y1 == BLOCK.y2){
  1195. X                if(BLOCK.x1 > BLOCK.x2){
  1196. X                    xa = BLOCK.x1;
  1197. X                    BLOCK.x1 = BLOCK.x2;
  1198. X                    BLOCK.x2 = xa;
  1199. X                }
  1200. X            }
  1201. X#ifdef _LOCAL
  1202. X            show_status( " WENDY: Blockende markiert. " );
  1203. X#else
  1204. X            show_status( " WENDY: End of block marked. ");
  1205. X#endif
  1206. X        }
  1207. X        show_screen( START );
  1208. X    }
  1209. X  }
  1210. X  activate( RTF_attrib );
  1211. X  ansi2( "cm", x, y );
  1212. X}
  1213. X
  1214. X
  1215. X
  1216. X/*    Block sichern        */
  1217. X
  1218. Xblock_ctrlw()
  1219. X{
  1220. X  FILE *fp;
  1221. X  unsigned char s[LONGSTRING];
  1222. X  unsigned char a[LONGSTRING];  
  1223. X  unsigned char p[STRING];
  1224. X  int i;
  1225. X  int o = BLOCK.y1;
  1226. X
  1227. X#ifdef _LOCAL
  1228. X  show_status( " WENDY: Block sichern. Dateiname? " );
  1229. X#else
  1230. X  show_status( " WENDY: Save block. Filename? " );
  1231. X#endif
  1232. X  ansi( "mr", 0, 0 );
  1233. X  strcpy(p, (unsigned char *) getline( 20, 1, ' ', "" ));
  1234. X
  1235. X  fp = fopen( p, "w" );
  1236. X  if(fp == NULL){
  1237. X    printf("%c", 7);
  1238. X#ifdef _LOCAL
  1239. X    sprintf(s, " WENDY: Fehler <%d>! ", p);
  1240. X#else
  1241. X    sprintf(s, " WENDY: Error <%d>! ", p);
  1242. X#endif
  1243. X    show_screen( s );
  1244. X    return;
  1245. X  }
  1246. X
  1247. X  rtf_convert( TEXT[o], 1, o);
  1248. X  strcpy(s, (unsigned char *) strcopy(SCREEN[1], (BLOCK.x1 -1), MAXX));
  1249. X  strcpy(a, (unsigned char *) strcopy(ATTRIB[1], (BLOCK.x1 -1), MAXX));
  1250. X  if(BLOCK.y1 == BLOCK.y2){
  1251. X    s[(BLOCK.x2 - BLOCK.x1 + 1)] = '\0';
  1252. X    a[(BLOCK.x2 - BLOCK.x1 + 1)] = '\0';
  1253. X  }
  1254. X
  1255. X  fprintf(fp, "%s\n", (unsigned char *) make_rtf( s, a ));
  1256. X  o++;
  1257. X
  1258. X  if(BLOCK.y1 == BLOCK.y2) goto NOTAUSGANG;
  1259. X
  1260. X  if((BLOCK.y2 - BLOCK.y1) > 1){ 
  1261. X    do{
  1262. X        fprintf(fp, "%s\n", (unsigned char *) TEXT[o]);
  1263. X        o++;
  1264. X    }while(o < BLOCK.y2); 
  1265. X  }
  1266. X
  1267. X  rtf_convert( TEXT[o], 1, o);
  1268. X  strcpy(s, (unsigned char *) strcopy(SCREEN[1], 0, (BLOCK.x2 -1)));
  1269. X  strcpy(a, (unsigned char *) strcopy(ATTRIB[1], 0, (BLOCK.x2 -1)));
  1270. X  fprintf(fp, "%s\n", (unsigned char *) make_rtf( s, a ));
  1271. X
  1272. X  NOTAUSGANG:
  1273. X
  1274. X  fclose(fp);
  1275. X
  1276. X  BLOCK.status = 0;
  1277. X
  1278. X  activate( RTF_attrib );
  1279. X  ansi2( "cm", x, y );  
  1280. X}
  1281. X
  1282. X
  1283. X
  1284. X/*    Block ''attributieren''        */
  1285. X
  1286. Xblock_ctrlu()
  1287. X{
  1288. X  int i;
  1289. X  int o = BLOCK.y1;
  1290. X  int ymem = y;
  1291. X
  1292. X  restore_screen( ypos );
  1293. X
  1294. X  rtf_convert( TEXT[o], 1, o );
  1295. X  y = 1;
  1296. X
  1297. X  if(BLOCK.y1 == BLOCK.y2){
  1298. X    for(i = (BLOCK.x1 -1); i <= (BLOCK.x2 -1); i++){
  1299. X        ATTRIB[1][i] = RTF_attrib;
  1300. X    }
  1301. X  }
  1302. X  else{
  1303. X    for(i = (BLOCK.x1 -1); i <= MAXX; i++){
  1304. X        ATTRIB[1][i] = RTF_attrib;
  1305. X    }
  1306. X  }
  1307. X  if(FORMATTER == 'b') blockset();
  1308. X  strcpy(TEXT[o], (unsigned char *) make_rtf( SCREEN[1], ATTRIB[1] ));
  1309. X  if(FORMATTER == 'c') FLAG[o] |= is_centered;
  1310. X  if(BLOCK.y1 == BLOCK.y2) goto NOTAUSGANG;
  1311. X  o++;
  1312. X
  1313. X  if((BLOCK.y2 - BLOCK.y1) > 1){
  1314. X    do{
  1315. X        rtf_convert( TEXT[o], 1, o );
  1316. X        memset(ATTRIB[1], RTF_attrib, MAXX);
  1317. X        if(FORMATTER == 'b') blockset();
  1318. X        strcpy(TEXT[o], (unsigned char *) make_rtf( SCREEN[1], ATTRIB[1] ));
  1319. X        if(FORMATTER == 'c') FLAG[o] |= is_centered;
  1320. X        o++;
  1321. X    }while(o < BLOCK.y2); 
  1322. X  }
  1323. X  rtf_convert( TEXT[o], 1, o );
  1324. X  
  1325. X  for(i = 0; i <= (BLOCK.x2 -1); i++){
  1326. X    ATTRIB[1][i] = RTF_attrib;
  1327. X  }
  1328. X  if(FORMATTER == 'b') blockset();
  1329. X  strcpy(TEXT[o], (unsigned char *) make_rtf( SCREEN[1], ATTRIB[1] ));
  1330. X  if(FORMATTER == 'c') FLAG[o] |= is_centered;
  1331. X
  1332. X  NOTAUSGANG:
  1333. X
  1334. X  BLOCK.status = 0;
  1335. X
  1336. X  prep_screen( ypos );
  1337. X  show_screen( START );
  1338. X  y = ymem;
  1339. X  ansi2( "cm", x, y );  
  1340. X}
  1341. X
  1342. X
  1343. X/*    Block loeschen        */
  1344. X
  1345. Xblock_ctrly()
  1346. X{
  1347. X  int i;
  1348. X  int start = BLOCK.y1 + 1;
  1349. X  int diff  = BLOCK.y2 - BLOCK.y1; /* + 1 */
  1350. X  int dummy;
  1351. X
  1352. X  unsigned char s[LONGSTRING];
  1353. X  unsigned char a[LONGSTRING];
  1354. X
  1355. X  restore_screen( ypos );
  1356. X
  1357. X  if(BLOCK.y1 == BLOCK.y2){
  1358. X    dummy = MAXX - (BLOCK.x2 - BLOCK.x1);
  1359. X    for(i = 0; i < dummy; i++){
  1360. X        SCREEN[y][(BLOCK.x1 + i - 1)] = SCREEN[y][(BLOCK.x2 + i)];
  1361. X        ATTRIB[y][(BLOCK.x1 + i - 1)] = ATTRIB[y][(BLOCK.x2 + i)];
  1362. X    }       
  1363. X    diff = i + 1;
  1364. X    for(i = diff; i < MAXX; i++){
  1365. X        SCREEN[y][i] = ' ';
  1366. X        ATTRIB[y][i] = '0';
  1367. X    }    
  1368. X    strcpy(TEXT[(ypos + y - 1)], (unsigned char *) make_rtf( SCREEN[y], ATTRIB[y] ));
  1369. X    goto NOTAUSGANG;
  1370. X  }
  1371. X
  1372. X  SCREEN[BLOCK.y1][(BLOCK.x1 - 1)] = '\0';
  1373. X  ATTRIB[BLOCK.y1][(BLOCK.x1 - 1)] = '\0';
  1374. X
  1375. X  rtf_convert( TEXT[BLOCK.y2], 26, BLOCK.y2 );  
  1376. X
  1377. X  strcpy(s, (unsigned char *) SCREEN[BLOCK.y1]);
  1378. X  strcpy(a, (unsigned char *) ATTRIB[BLOCK.y1]);
  1379. X
  1380. X  strcat(s, (unsigned char *) strcopy(SCREEN[26], BLOCK.x2, MAXX));
  1381. X  strcat(a, (unsigned char *) strcopy(ATTRIB[26], BLOCK.x2, MAXX));
  1382. X
  1383. X  strcpy(TEXT[BLOCK.y1], (unsigned char *) make_rtf( s, a ));  
  1384. X
  1385. X  for(i = start; i <= lastline; i++){
  1386. X    strcpy(TEXT[i], (unsigned char *) TEXT[(i + diff)]);
  1387. X      FLAG[i] = FLAG[(i + diff)];
  1388. X  } 
  1389. X  lastline -= diff;
  1390. X
  1391. X  NOTAUSGANG:
  1392. X
  1393. X  BLOCK.status = 0;
  1394. X  ypos = BLOCK.ypos;
  1395. X  x = BLOCK.x1;
  1396. X  y = BLOCK.y;
  1397. X
  1398. X  prep_screen( ypos );
  1399. X  show_screen( START );
  1400. X  ansi2( "cm", x, y );  
  1401. X}
  1402. END_OF_FILE
  1403.   if test 5294 -ne `wc -c <'wendy/block.c'`; then
  1404.     echo shar: \"'wendy/block.c'\" unpacked with wrong size!
  1405.   fi
  1406.   # end of 'wendy/block.c'
  1407. fi
  1408. if test -f 'wendy/rtf.c' -a "${1}" != "-c" ; then 
  1409.   echo shar: Will not clobber existing file \"'wendy/rtf.c'\"
  1410. else
  1411.   echo shar: Extracting \"'wendy/rtf.c'\" \(6396 characters\)
  1412.   sed "s/^X//" >'wendy/rtf.c' <<'END_OF_FILE'
  1413. X#include "wendy.h"
  1414. X
  1415. X
  1416. X
  1417. X/*    Bildschirmzeile ins RTF umwandeln    */
  1418. X
  1419. Xunsigned char *make_rtf( t, a )
  1420. Xunsigned char t[], a[];
  1421. X{
  1422. X  unsigned char s[LONGSTRING];
  1423. X  unsigned char q[LONGSTRING];
  1424. X  int olda = '0';
  1425. X  int i = 0;
  1426. X  int l = 0;
  1427. X
  1428. X  unsigned char line[1024];
  1429. X
  1430. X  strcpy(q, (unsigned char *) t);  strcpy(s, (unsigned char *) right_stripped(q));
  1431. X
  1432. X  strcat(s, (unsigned char *) "`");
  1433. X  strcat(a, (unsigned char *) "0");
  1434. X
  1435. X  if(s[0] == '~'){
  1436. X    line[0] = '~';
  1437. X    l++;
  1438. X    i++;
  1439. X  }
  1440. X
  1441. X  if(strcomp("        ", s) == 0){     /* TAB for Makefiles ;-) */
  1442. X    line[l] = TAB;
  1443. X    l++;
  1444. X    i += 8;
  1445. X  }
  1446. X
  1447. X  while((s[i] != '\0') && (l < LINELENGTH)){
  1448. X    if(s[i] == BLANK) s[i] = ' ';
  1449. X    if(a[i] != olda){
  1450. X        line[l] = '\0';
  1451. X        if(olda == '0'){
  1452. X            switch(a[i]){
  1453. X                case 'b' : strcat(line, (unsigned char *) "<Bold>");
  1454. X                       break;    
  1455. X                case 'i' : strcat(line, (unsigned char *) "<Italic>");
  1456. X                       break;
  1457. X                case 'f' : strcat(line, (unsigned char *) "<Fixed>");
  1458. X                       break;
  1459. X                case 'u' : strcat(line, (unsigned char *) "<Underline>");
  1460. X                       break;
  1461. X            }
  1462. X        }
  1463. X        else{
  1464. X            switch(olda){
  1465. X                case 'b' : strcat(line, (unsigned char *) "</Bold>");
  1466. X                       break;    
  1467. X                case 'i' : strcat(line, (unsigned char *) "</Italic>");
  1468. X                       break;
  1469. X                case 'f' : strcat(line, (unsigned char *) "</Fixed>");
  1470. X                       break;
  1471. X                case 'u' : strcat(line, (unsigned char *) "</Underline>");
  1472. X                       break;
  1473. X            }
  1474. X        }
  1475. X        olda = a[i];
  1476. X        l = strlen(line);
  1477. X    }
  1478. X    if(s[i] != '`'){
  1479. X        line[l] = s[i];
  1480. X        l++;        
  1481. X    }
  1482. X    i++;
  1483. X  }
  1484. X
  1485. X  line[l] = ' '; line[l+1] = '\0'; /* !!!? */
  1486. X
  1487. X  return (unsigned char *) line;
  1488. X}
  1489. X
  1490. X
  1491. X
  1492. X/*    RTF-Zeile in Bildschirmzeile umwandeln    */
  1493. X
  1494. Xrtf_convert( line, scrpos, tpos )
  1495. Xunsigned char line[];
  1496. Xint scrpos;
  1497. Xint tpos;
  1498. X{
  1499. X  unsigned char s[LINELENGTH];
  1500. X
  1501. X  unsigned char screen[1024];
  1502. X  unsigned char attrib[1024];
  1503. X  unsigned char scr2[1024];
  1504. X  unsigned char att2[1024];
  1505. X
  1506. X  int i = 0;
  1507. X  int l = 0;
  1508. X  int j = 0;
  1509. X  int c = 0;
  1510. X
  1511. X  int rtf = 0;
  1512. X  int RTF_local = '0';
  1513. X
  1514. X  screen[0] = '\0';
  1515. X  attrib[0] = '\0';
  1516. X
  1517. X  while(line[i] != '\0'){
  1518. X    rtf = 0;
  1519. X    if(line[i] > 127){
  1520. X        if(strcomp("iso", umlaut) == 0){
  1521. X            switch(line[i]){
  1522. X                case 142 : line[i] = 196; 
  1523. X                       break;
  1524. X                case 153 : line[i] = 214; 
  1525. X                       break;
  1526. X                case 154 : line[i] = 220; 
  1527. X                       break;
  1528. X                case 225 : line[i] = 223; 
  1529. X                       break;
  1530. X                case 132 : line[i] = 228; 
  1531. X                       break;
  1532. X                case 148 : line[i] = 246;
  1533. X                       break;
  1534. X                case 129 : line[i] = 252; 
  1535. X                       break;
  1536. X            }
  1537. X        }
  1538. X        if(strcomp("ibm", umlaut) == 0){
  1539. X            switch(line[i]){
  1540. X                case 196 : line[i] = 142; 
  1541. X                       break;
  1542. X                case 214 : line[i] = 153; 
  1543. X                       break;
  1544. X                case 220 : line[i] = 154; 
  1545. X                       break;
  1546. X                case 223 : line[i] = 225; 
  1547. X                       break;
  1548. X                case 228 : line[i] = 132; 
  1549. X                       break;
  1550. X                case 246 : line[i] = 148;
  1551. X                       break;
  1552. X                case 252 : line[i] = 129; 
  1553. X                       break;
  1554. X            }
  1555. X        }
  1556. X    }
  1557. X    if(line[i] == ' ') line[i] = BLANK;
  1558. X    if(line[i] == '<'){
  1559. X        if(line[(i+1)] == '/'){
  1560. X            rtf++;
  1561. X        }
  1562. X        else{
  1563. X            strcpy(s, (unsigned char *) strcopy(line, (i+1), strlen(line)));
  1564. X            if((strcomp("Bold",        s) == 0) ||
  1565. X               (strcomp("Italic",      s) == 0) ||
  1566. X               (strcomp("Fixed",       s) == 0) ||
  1567. X               (strcomp("Smaller",     s) == 0) ||
  1568. X               (strcomp("Bigger",      s) == 0) ||
  1569. X               (strcomp("Underline",   s) == 0) ||
  1570. X               (strcomp("Center",      s) == 0) ||
  1571. X               (strcomp("Flush",       s) == 0) ||
  1572. X               (strcomp("Indent",      s) == 0) ||
  1573. X                (strcomp("Outdent",     s) == 0) ||
  1574. X               (strcomp("Samepage",    s) == 0) ||
  1575. X                   (strcomp("Subscript",   s) == 0) ||
  1576. X               (strcomp("Superscript", s) == 0) ||
  1577. X               (strcomp("Heading",     s) == 0) ||
  1578. X               (strcomp("Footing",     s) == 0) ||
  1579. X               (strcomp("ISO-8859-",   s) == 0) ||
  1580. X               (strcomp("US-ASCII",    s) == 0) ||
  1581. X               (strcomp("Excerpt",     s) == 0) ||
  1582. X               (strcomp("Paragraph",   s) == 0) ||
  1583. X               (strcomp("Signature",   s) == 0) ||
  1584. X                   (strcomp("Comment",     s) == 0) ||
  1585. X               (strcomp("nl",          s) == 0) ||
  1586. X               (strcomp("np",          s) == 0) ||
  1587. X               (strcomp("lt",          s) == 0) ||
  1588. X               (strcomp("No-op",       s) == 0)) rtf++;
  1589. X        }
  1590. X        }
  1591. X
  1592. X    if(rtf == 0){
  1593. X        if(line[i] == TAB){
  1594. X            j = (((int)(l+8)/8) * 8) - l;
  1595. X            strcpy(s, "            "); s[j] = '\0';                        
  1596. X            screen[l] = '\0'; strcat(screen, (unsigned char *) s);
  1597. X            strcpy(s, "000000000000"); s[j] = '\0';
  1598. X            attrib[l] = '\0'; strcat(attrib, (unsigned char *) s);
  1599. X            l += (j -1);
  1600. X        }
  1601. X        else{
  1602. X            if(line[i] > 31){
  1603. X                screen[l] = line[i];
  1604. X                attrib[l] = RTF_local;
  1605. X            }
  1606. X        }
  1607. X        l++;
  1608. X    }        
  1609. X    else{
  1610. X        j = i + 1;
  1611. X        while((line[i] != '>') && (line[i] != '\0')){
  1612. X            i++;
  1613. X        }
  1614. X
  1615. X        strcpy(s, (unsigned char *) strcopy(line, j, (i-1)));
  1616. X
  1617. X        if(s[0] == '/'){
  1618. X            RTF_local = '0';
  1619. X        }        
  1620. X        else{
  1621. X            if(strcomp("nl", s) != 0){
  1622. X                c = s[0]; if(c < 97) c += 32;
  1623. X                if((c == 'b') || (c == 'i') || (c == 'f') || (c == 'u')){
  1624. X                    RTF_local = c;
  1625. X                }
  1626. X                if(c == 'c'){
  1627. X                    FLAG[(ypos + scrpos -1)] |= is_centered;
  1628. X                }
  1629. X                if(strcomp("lt", s) == 0){
  1630. X                    screen[l] = '<';
  1631. X                    attrib[l] = RTF_local;
  1632. X                    l++;
  1633. X                }
  1634. X            }
  1635. X        }
  1636. X    }
  1637. X    i++;
  1638. X  }
  1639. X  l--;
  1640. X
  1641. X  while(l < MAXX){
  1642. X    screen[l] = ' ';
  1643. X    attrib[l] = '0';
  1644. X    l++;
  1645. X  }
  1646. X  screen[l] = '\0';
  1647. X  attrib[l] = '\0';
  1648. X  sprintf(SCREEN[scrpos], "%-*.*s", MAXX, MAXX, (unsigned char *) screen);
  1649. X  sprintf(ATTRIB[scrpos], "%-*.*s", MAXX, MAXX, (unsigned char *) attrib);
  1650. X
  1651. X  if(l > MAXX){
  1652. X    strcpy(screen, (unsigned char *) strcopy(screen, (MAXX-1), l));
  1653. X    strcpy(attrib, (unsigned char *) strcopy(attrib, (MAXX-1), l));
  1654. X    
  1655. X    screen[0] = '~';
  1656. X    attrib[0] = '0';
  1657. X
  1658. X    for(i = lastline; i > tpos; i--){
  1659. X        strcpy(TEXT[(i+1)], (unsigned char *) TEXT[i]);
  1660. X        FLAG[(i+1)] = FLAG[i];
  1661. X    }
  1662. X    lastline++;    
  1663. X    tpos++;
  1664. X    strcpy(TEXT[tpos], (unsigned char *) make_rtf( screen, attrib ));
  1665. X  }  
  1666. X
  1667. X  if(((FLAG[tpos] & is_centered) == is_centered) && (SCREEN[scrpos][0] != ' ')){
  1668. X    strcpy(screen, (unsigned char *) SCREEN[scrpos]);
  1669. X    strcpy(attrib, (unsigned char *) ATTRIB[scrpos]);
  1670. X    strcpy(s, (unsigned char *) SCREEN[scrpos]); i = strlen((unsigned char *) right_stripped(s));
  1671. X    j = (MAXX - i) / 2;
  1672. X    strcpy(SCREEN[scrpos], (unsigned char *) "                                                                              ");                   
  1673. X    strcpy(ATTRIB[scrpos], (unsigned char *) "000000000000000000000000000000000000000000000000000000000000000000000000000000");
  1674. X    SCREEN[scrpos][j] = '\0';
  1675. X    ATTRIB[scrpos][j] = '\0';
  1676. X        screen[i] = '\0';
  1677. X    strcat(SCREEN[scrpos], (unsigned char *) screen);
  1678. X    attrib[i] = '\0';
  1679. X    strcat(ATTRIB[scrpos], (unsigned char *) attrib);
  1680. X  }
  1681. X}
  1682. END_OF_FILE
  1683.   if test 6396 -ne `wc -c <'wendy/rtf.c'`; then
  1684.     echo shar: \"'wendy/rtf.c'\" unpacked with wrong size!
  1685.   fi
  1686.   # end of 'wendy/rtf.c'
  1687. fi
  1688. if test -f 'wendy/screen.c' -a "${1}" != "-c" ; then 
  1689.   echo shar: Will not clobber existing file \"'wendy/screen.c'\"
  1690. else
  1691.   echo shar: Extracting \"'wendy/screen.c'\" \(3798 characters\)
  1692.   sed "s/^X//" >'wendy/screen.c' <<'END_OF_FILE'
  1693. X#include "wendy.h"
  1694. X/*      ANSI-Sequenz fuer Attribute senden      */
  1695. Xactivate( c )
  1696. Xint c;
  1697. X{
  1698. X  ansi( "me" );
  1699. X
  1700. X  switch(c){
  1701. X        case 'b' : ansi( "md" );
  1702. X                   break;
  1703. X        case 'i' : ansi( "mr" );
  1704. X                   break;
  1705. X        case 'f' : ansi( "mb" );
  1706. X                   break;
  1707. X        case 'u' : ansi( "us" );
  1708. X                   break;
  1709. X    case 'c' : break;
  1710. X        default  : RTF_attrib = '0';
  1711. X  }
  1712. X}
  1713. X/*      Zeile mit Attributen anzeigen   */
  1714. Xshow_line( s, a, start )
  1715. Xunsigned char s[], a[];
  1716. Xint start;
  1717. X{
  1718. X  int olda = '0';
  1719. X  int i = 0;
  1720. X  int l = 0;
  1721. X  int dummy = (ypos + y) -1;
  1722. X  int set = 0;
  1723. X  unsigned char line[1024];
  1724. X  i = start -1;
  1725. X  ansi2( "cm", start, y );
  1726. X  while(s[i] != '\0'){
  1727. X
  1728. X    if(BLOCK.status == BLOCKMODE){
  1729. X        line[l] = '\0';
  1730. X        if((dummy == BLOCK.y1) && (i == (BLOCK.x1 -1))){
  1731. X            if(set == 0){
  1732. X                strcat(line, (unsigned char *) termansi( "md" ));
  1733. X                set++;
  1734. X            }
  1735. X        }
  1736. X        if((dummy > BLOCK.y1) && (dummy < BLOCK.y2)){
  1737. X            if(set == 0){
  1738. X                strcat(line, (unsigned char *) termansi( "md" ));
  1739. X                set++;
  1740. X            }
  1741. X        }
  1742. X        if((dummy == BLOCK.y2) && (i == BLOCK.x2)){
  1743. X            if((BLOCK.y1 == BLOCK.y2) && (set != 99)){
  1744. X                set = 99;
  1745. X            }
  1746. X            if((set == 0) || (set == 99)){
  1747. X                strcat(line, (unsigned char *) termansi( "me" ));
  1748. X                if(set != 99) set++;
  1749. X            }
  1750. X        }
  1751. X        if(dummy > BLOCK.y2){
  1752. X            if(set == 0){
  1753. X                strcat(line, (unsigned char *) termansi( "me" ));
  1754. X                set++;
  1755. X            }
  1756. X        }
  1757. X        
  1758. X        if(((dummy >  BLOCK.y1) && (dummy < BLOCK.y2)) ||
  1759. X                   ((dummy == BLOCK.y1) && (i > BLOCK.x1))     ||
  1760. X           ((dummy == BLOCK.y2) && (i < BLOCK.x2))) olda = a[i];
  1761. X
  1762. X        l = strlen(line);
  1763. X    }
  1764. X
  1765. X        if(a[i] != olda){
  1766. X                olda = a[i];
  1767. X                line[l] = '\0';
  1768. X        strcat(line, (unsigned char *) termansi( "me" ));
  1769. X                switch(olda){
  1770. X                        case 'b' : strcat(line, (unsigned char *) termansi( "md" ));
  1771. X                                   break;
  1772. X                        case 'i' : strcat(line, (unsigned char *) termansi( "mr" ));
  1773. X                                   break;
  1774. X                        case 'f' : strcat(line, (unsigned char *) termansi( "mb" ));
  1775. X                                   break;
  1776. X                        case 'u' : strcat(line, (unsigned char *) termansi( "us" ));
  1777. X                                   break;
  1778. X                }
  1779. X        l = strlen(line);
  1780. X        }
  1781. X    if(s[i] == BLANK)
  1782. X        line[l] = ' ';
  1783. X    else
  1784. X            line[l] = s[i];
  1785. X        l++;
  1786. X        i++;
  1787. X  }
  1788. X  line[l] = '\0';
  1789. X  if(start == 1) ansi( "ce" );
  1790. X  printf("%s", (unsigned char *) right_stripped( (unsigned char *) line));
  1791. X}
  1792. X/*      Bildschirm mit Attributen aufbauen      */
  1793. Xshow_screen( start )
  1794. Xint start;
  1795. X{
  1796. X  int i, xmem = x, ymem = y;
  1797. X  ansi( "me" );
  1798. X  x = 1; y = start;
  1799. X  for(i = start; i <= MAXY; i++){
  1800. X        show_line( (unsigned char *) SCREEN[i], (unsigned char *) ATTRIB[i], 1 );
  1801. X        y++;
  1802. X  }
  1803. X  x = xmem; y = ymem;
  1804. X  activate( RTF_attrib );
  1805. X  ansi2( "cm", x, y );
  1806. X}
  1807. X/*      Bildschirminhalt aus RTF-Datei bilden   */
  1808. Xprep_screen( ypos )
  1809. Xint ypos;
  1810. X{
  1811. X  int i;
  1812. X  RTF_attrib = '0';
  1813. X  for(i = START; i <= MAXY; i++){
  1814. X        rtf_convert( TEXT[(ypos -1 + i)], i, (ypos -1 + i) );
  1815. X  }
  1816. X}
  1817. X/*      Bildschirminhalt ins RTF wandeln        */
  1818. Xrestore_screen( ypos )
  1819. Xint ypos;
  1820. X{
  1821. X  int i;
  1822. X  for(i = START; i <= MAXY; i++){
  1823. X        strcpy( TEXT[(ypos -1 + i)], (unsigned char *) make_rtf( SCREEN[i], ATTRIB[i] ));
  1824. X  }
  1825. X}
  1826. X/*      Status-Zeile ausgeben   */
  1827. Xshow_status( s )
  1828. Xunsigned char s[];
  1829. X{
  1830. X  unsigned char l[LONGSTRING];
  1831. X
  1832. X  strcpy(l, (unsigned char *) s);
  1833. X  strcat(l, "                                                                          ");
  1834. X  l[MAXX] = '\0';
  1835. X
  1836. X  ansi2( "cm", 1, 1 );
  1837. X  ansi( "mr" );
  1838. X  printf("%s", l);
  1839. X  ansi2( "cm", (strlen(s) +1), 1 );
  1840. X
  1841. X  STATUSM = 1;
  1842. X  activate( RTF_attrib );
  1843. X}
  1844. X
  1845. X
  1846. X
  1847. END_OF_FILE
  1848.   if test 3798 -ne `wc -c <'wendy/screen.c'`; then
  1849.     echo shar: \"'wendy/screen.c'\" unpacked with wrong size!
  1850.   fi
  1851.   # end of 'wendy/screen.c'
  1852. fi
  1853. if test -f 'wendy/wendy.dok.U' -a "${1}" != "-c" ; then 
  1854.   echo shar: Will not clobber existing file \"'wendy/wendy.dok.U'\"
  1855. else
  1856.   echo shar: Extracting \"'wendy/wendy.dok.U'\" \(4682 characters\)
  1857.   sed "s/^X//" >'wendy/wendy.dok.U' <<'END_OF_FILE'
  1858. Xbegin 644 wendy/wendy.dok
  1859. XM4&%T:#H@=6YN970A<F]O= I&<F]M.B!6;VQK97(@4V-H=65R;6%N;B \5F]L
  1860. XM:V5R+E-C:'5E<FUA;FY =6YN970N=RYO<&5N+D1%/@I297!L>2U4;SH@5F]L
  1861. XM:V5R+E-C:'5E<FUA;FY =6YN970N=RYO<&5N+D1%("A6;VQK97(@4V-H=65R
  1862. XM;6%N;BD*3F5W<V=R;W5P<SH@;&]C86PN=&%L:PI$:7-T<FEB=71I;VXZ('=O
  1863. XM<FQD"E-U8FIE8W0Z(")796YD>2(@+2!E:6X@<&%A<B!4:7!S(0I#;VYT96YT
  1864. XM+51Y<&4Z('1E>'0O<&QA:6X[(&-H87)S970]:7-O+3@X-3DM,0I#;VYT96YT
  1865. XM+51R86YS9F5R+45N8V]D:6YG.B X8FET"E@M3F5W<RU296%D97(Z(&EX+TU"
  1866. XM;W@@,2XV(%!,,3!J,B!B>2 \=F]L:V5R<T!U;FYE="YW+F]P96XN1$4^"DUE
  1867. XM<W-A9V4M240Z(#PR0C!"0C@S."XQ.$!U;FYE="YW+F]P96XN1$4^"D]R9V%N
  1868. XM:7IA=&EO;CH@5$A%(%5.1$521U)/54Y$($Y%5%=/4DL@*$)"4SH@*S0Y(#(P
  1869. XM,B T-C(Q,30O-#8V,#(S-"D*1&%T93H@5&AU+" Q.2!.;W8@.3(@,34Z-3(Z
  1870. XM,C8@0T54"DQI;F5S.B S-@H*0V]N=&5N="U4>7!E.B!T97AT+W)I8VAT97AT
  1871. XM.R!C:&%R<V5T/6ES;RTX.#4Y+3$*3F%T@7)L:6-H(&=I8G0G<R!S;W=A<R!W
  1872. XM:64@/$)O;&0^3TY,24Y%/"]";VQD/BU(:6QF92P@86)E<B!M96AR(&%L<R!E
  1873. XM:6YE($%U9FQI<W1U;F<\;FP^"F1E<B!V97)W96YD8F%R96X@5&%S=&5N:V]M
  1874. XM8FEN871I;VYE;B!B:65T970@<VEE(&YI8VAT("XN+CQN;#X*/&YL/@I$97-S
  1875. XM:&%L8B!H:65R(&5I;B!P86%R("AV:65L;&5I8VAT*2!N@71Z;&EC:&4@5&EP
  1876. XM<SH\;FP^"CQN;#X*;R \0F]L9#Y714Y$63PO0F]L9#X@=W5R9&4@9H%R(&1E
  1877. XM;B!/3DQ)3D4M0F5T<FEE8B!K;VYZ:7!I97)T+B!$97-S:&%L8B!I<W0@<VEE
  1878. XM(&EN/&YL/@H@(&1E<B!,86=E('9E<G-C:&EE9&5N<W1E(%1E<FUI;F%L+45M
  1879. XM=6QA=&EO;F5N('IU('5N=&5R<W2!='IE;BX\;FP^"CQN;#X*("!,96ED97(@
  1880. XM=VER9"!S:64@9&%D=7)C:"!N:6-H="!U;F)E9&EN9W0@<V-H;F5L;&5R+B!"
  1881. XM96D@;&%N9W-A;65R96X\;FP^"B @5F5R8FEN9'5N9V5N(&5M<&9I96AL="!S
  1882. XM:6-H(&1E<W=E9V5N(&9O;&=E;F1E<SH\;FP^"CQN;#X*(" \0F]L9#Y#5%),
  1883. XM+44\+T)O;&0^(&\N(#Q";VQD/D-44DPM4SPO0F]L9#XZ($5I;G-T96QL=6YG
  1884. XM(&1E<B!&96YS=&5R9W*4X64@875F(&-A+B Q,"!:96EL96X\;FP^"CQN;#X*
  1885. XM;R!-:70@/$)O;&0^0U123"U1/"]";VQD/B!W:7)D(&1E<B!%:6YF@6=E;6]D
  1886. XM=7,@86MT:79I97)T+B!!=6-H(&1E<B!S=&5L;'0@;FEC:'0\;FP^"B @9V5R
  1887. XM861E(&5I;F5N($)E<V-H;&5U;FEG97(@9&%R+B!$97-S:&%L8B!ME&=L:6-H
  1888. XM<W0@;F%C:"!D96T@16EN9H%G92T\;FP^"B @=F]R9V%N9R!D:7)E:W0@=VEE
  1889. XM9&5R(&UI=" \0F]L9#Y#5%),+5$\+T)O;&0^(&1E;B!-;V1U<R!B965N9&5N
  1890. XM(3QN;#X*/&YL/@IO(%IW87(@:V%N;B!M86X@<V5H<B!S8VB4;B!M:70@/$)O
  1891. XM;&0^4$=54#PO0F]L9#XO/$)O;&0^4$=$3CPO0F]L9#X@8GIW+B \0F]L9#Y#
  1892. XM5%),+4(\+T)O;&0^+SQ";VQD/D-44DPM1CPO0F]L9#X@8FR$='1E<FXL/&YL
  1893. XM/@H@(&%B97(@>G5M($%U9G-U8VAE;B!W96ET(&5N=&9E<FYT97(@5&5X='-T
  1894. XM96QL96X@:7-T(&1A<R!Z=2!L86YG<V%M+CQN;#X*/&YL/@H@($UI=" \0F]L
  1895. XM9#Y#5%),+4<\+T)O;&0^(&R$<W-T(&UA;B!S:6-H('-T871T(&1E<W-E;B!D
  1896. XM:64@6F5I;&5N86YZ86AL(&1E<B!$871E:3QN;#X*("!A=7-G96)E;BP@=6YD
  1897. XM('-P<FEN9W0@9&%N;B!M:70@/$)O;&0^15-#.CPO0F]L9#X@6UIE:6QE;FYU
  1898. XM;6UE<ET@86X@9&EE(&=E=X%N<V-H=&4\;FP^"B @4W1E;&QE+CQN;#X*/&YL
  1899. XM/@H@()IB<FEN9V5N<R!V97)S=&5C:W0@<VEC:"!H:6YT97(@9&5M(#Q";VQD
  1900. XM/D530SH\+T)O;&0^(&YO8V@@:V5I;B!K;VUP;&5T=&5R(%9)+4UO9'5S(3QN
  1901. XM;#X*/&YL/@IO(%IE:6QE;B!W97)D96X@96EN9V5F@6=T+"!I;F1E;2!M86X@
  1902. XM;6ET(#Q";VQD/D-44DPM43PO0F]L9#X@:6X@9&5N($5I;F:!9V5M;V1U<SQN
  1903. XM;#X*("!W96-H<V5L="P@=6YD(&1O<G0@;6ET(#Q";VQD/D5.5$52/"]";VQD
  1904. XM/B!D96X@5&5X="!U;G1E<B!D97(@86MT=65L;&5N(%IE:6QE('5M/&YL/@H@
  1905. XM(&5I;F4@6F5I;&4@=V5I=&5R(&YO8V@@=6YT96X@<H%C:W0N/&YL/@H\;FP^
  1906. XM"F\@4V]L;'1E(&1E<B!":6QD<V-H:7)M(&1U8V@@4W24<G5N9V5N(&1U<F-H
  1907. XM96EN86YD97(@9V5R871E;B!S96EN+"!LA'-S=#QN;#X*("!E<B!S:6-H(&UI
  1908. XM=" \0F]L9#Y#5%),+4P\+T)O;&0^(&\N(#Q";VQD/D-44DPM4CPO0F]L9#X@
  1909. XM=VEE9&5R:&5R<W1E;&QE;BX\;FP^"CQN;#X*;R!$:64@9W5T92 \0F]L9#Y7
  1910. XM14Y$63PO0F]L9#X@:V%N;B!M87@N(#@P(%IE:6-H96X@<')O(%IE:6QE(&1A
  1911. XM<G-T96QL96XN($%U<R!D:65S96T\;FP^"B @1W)U;F0@;8%S<V5N(&R$;F=E
  1912. XM<F4@6F5I;&4@=6UG96)R;V-H96X@=V5R9&5N+B!$:65S92 B@6)E<G-T96AE
  1913. XM;F1E;B(\;FP^"B @6F5I;&5N('=E<F1E(&1U<F-H(&5I;F4@6WY=(&%M(%IE
  1914. XM:6QE;F%N9F%N9R!G96ME;FYZ96EC:&YE="X\;FP^"CQN;#X*("!$87,@:V%N
  1915. XM;B!M86X@<VEC:"!Z=6YU='IE(&UA8VAE;BP@=V5N;B!M86X@<V5L8G-T(%IE
  1916. XM:6QE;B!M:70@;65H<CQN;#X*("!A;',@.# @6F5I8VAE;B!E<F9A<W-E;B!W
  1917. XM:6QL+B!%:6YE(%M^72!A;2!!;F9A;F<@9&5R('IW96ET96X@*"$I('5N9#QN
  1918. XM;#X*("!A;&QE<B!W96ET97)E;B!:96EL96X@9V5N@6=T+CQN;#X*/&YL/@IO
  1919. XM($EN('9I96QE;B!&A&QL96X@<VEN9"!B96D@06YG86)E;B!Z=2!487-T96YK
  1920. XM;VUB:6YA=&EO;F5N('IU<X1T>FQI8V@\;FP^"B @;F]C:"!!=7-D<H%C:V4@
  1921. XM875F9V5L:7-T970L(&1I92!S:6-H('=I92!!=69D<G5C:V4@=F]N(%1A<W1E
  1922. XM;B!A;FB4<F5N+CQN;#X*("!$87,@8F5D975T970L(&1AX2!M86X@>BY"+B \
  1923. XM0F]L9#Y#5%),+48\+T)O;&0^(&1R@6-K96X@:V%N;B!U;2!E:6YE(%-E:71E
  1924. XM('9O<GIU+3QN;#X*("!B;(1T=&5R;BP@86)E<B!D87,@9VQE:6-H92!W@7)D
  1925. XM92!E:6X@1')U8VL@875F(#Q";VQD/E!'1$X\+T)O;&0^(&)E=VER:V5N+CQN
  1926. XM;#X*/&YL/@H@(%=E<B!E:6X@(F%N<W2$;F1I9V5S(B!497)M:6YA;%!21R!B
  1927. XM96YU='IT+"!S;VQL=&4@86QS;R!D:64@96YS='!R96-H96YD96X\;FP^"B @
  1928. XM5&%S=&5N('-T871T(&1E<B!#5%),+4MO;6)I;F%T:6]N96X@=F5R=V5N9&5N
  1929. XM(&N4;FYE;B$\;FP^"CQN;#X*0V]N=&5N="U4>7!E.B!T97AT+W!L86EN.R!C
  1930. XM:&%R<V5T/6ES;RTX.#4Y+3$*+2!6;VQK97(@4V-H=65R;6%N;B @(" @(" @
  1931. XM(" @(" @(" @(" @(" @(" @(" @("!554-0.B!V;VQK97)S0'5N;F5T+G<N
  1932. XM;W!E;BYD90H@(%1H92!5;F1E<F=R;W5N9"!.971W;W)K+"!'97)M86YY(" @
  1933. XK(" @(" @(" @(" @(" @(" @(" @(" @(" @("!;0V%R<&4@9&EE;2%="B @
  1934. Xend
  1935. END_OF_FILE
  1936.   if test 4682 -ne `wc -c <'wendy/wendy.dok.U'`; then
  1937.     echo shar: \"'wendy/wendy.dok.U'\" unpacked with wrong size!
  1938.   else
  1939.     echo shar: Uudecoding \"'wendy/wendy.dok'\" \(3373 characters\)
  1940.     cat wendy/wendy.dok.U | uudecode
  1941.     if test 3373 -ne `wc -c <'wendy/wendy.dok'`; then
  1942.       echo shar: \"'wendy/wendy.dok'\" uudecoded with wrong size!
  1943.     else
  1944.       rm wendy/wendy.dok.U
  1945.     fi
  1946.   fi
  1947.   # end of 'wendy/wendy.dok.U'
  1948. fi
  1949. echo shar: End of archive 13 \(of 15\).
  1950. cp /dev/null ark13isdone
  1951. MISSING=""
  1952. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do
  1953.     if test ! -f ark${I}isdone ; then
  1954.     MISSING="${MISSING} ${I}"
  1955.     fi
  1956. done
  1957. if test "${MISSING}" = "" ; then
  1958.     echo You have unpacked all 15 archives.
  1959.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1960. else
  1961.     echo You still must unpack the following archives:
  1962.     echo "        " ${MISSING}
  1963. fi
  1964. exit 0
  1965. exit 0 # Just in case...
  1966.