home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume29 / mbox / part07 < prev    next >
Encoding:
Text File  |  1992-04-05  |  54.5 KB  |  2,183 lines

  1. Newsgroups: comp.sources.misc
  2. From: Volker.Schuermann@unnet.w.open.de@unnet (Volker Schuermann)
  3. Subject:  v29i069:  mbox - A Bulletin Board System for UNIX and MINIX, Part07/10
  4. Message-ID: <1992Apr5.183617.29887@sparky.imd.sterling.com>
  5. X-Md4-Signature: 70340675a0150e9c13ee73aa72e3d766
  6. Date: Sun, 5 Apr 1992 18:36:17 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Volker.Schuermann@unnet.w.open.de@unnet (Volker Schuermann)
  10. Posting-number: Volume 29, Issue 69
  11. Archive-name: mbox/part07
  12. Environment: MINIX, ISC, ESIX, SVR3
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then feed it
  16. # into a shell via "sh file" or similar.  To overwrite existing files,
  17. # type "sh file -c".
  18. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  19. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  20. # Contents:  Changelog TUTORIAL etc/english.hilfe src/bled.c
  21. #   src/lesen2.c
  22. # Wrapped by kent@sparky on Sun Apr  5 11:57:45 1992
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. echo If this archive is complete, you will see the following message:
  25. echo '          "shar: End of archive 7 (of 10)."'
  26. if test -f 'Changelog' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'Changelog'\"
  28. else
  29.   echo shar: Extracting \"'Changelog'\" \(8260 characters\)
  30.   sed "s/^X//" >'Changelog' <<'END_OF_FILE'
  31. X
  32. XHeute, nach einem Telefonat mit Volker haben wir beschlossen die Versionen
  33. Xder ix/MBox mal auf einen Gleichstand zu bringen.
  34. X
  35. XDa inzwischen mehrere Leute an der Box programmieren, verliert man leicht
  36. Xden Ueberblick, wenn nicht von einem definierten Stand der Version ausge-
  37. Xgangen wird.
  38. X
  39. XDie Version 1.6.0 soll deshalb die Version sein, auf die sich alle nach-
  40. Xfolgenden Aenderungen beziehen!
  41. X
  42. XAlso wenn Aenderungen gemacht werden, diff's erzeugen und Volker schicken.
  43. XDabei sollte man die Angabe der Version (ab Version 1.6.0) und Patchlevel
  44. Xnicht vergessen, auf die sich das Diff bezieht!
  45. X
  46. XUm Aenderungen nachvollziehen zu koennen, waehre meine Bitte, an dieses
  47. XFile kurze Erlaeuterungen zu den Aenderungen anzuhaengen!
  48. X
  49. X---------------------------------------------------------------------------
  50. X
  51. XSat Nov 16 02:21:20 MEZ 1991, Hergo Pape <hergo@ivcmd.Boerde.DE>
  52. X
  53. Xix/MBox 1.6 PL1::
  54. X
  55. X-  File patchlevel.h eingefuert, hier sind die Version, der Autor und
  56. X   die aktuelle Patchlevel definiert. Das File wird in mbox.h eingelesen.
  57. X
  58. X-  Makefile geaendert, "bled" braucht nicht mehr extra uebersetzt werden.
  59. X   Die Variable MBOXHOME eingefuehrt, daher man kann jetzt die Sourcen
  60. X   irgendwo uebersetzen und installiert wird in MBOXHOME. Ist meiner Meinung
  61. X   nach guenstiger fuer die Versionskontrolle.
  62. X
  63. X-  In nerror() den Aufruf der Funktion loop() gegen longjmp() ausgetauscht.
  64. X   Zumindest unter ISC gibt es jetzt kein core mehr beim verlassen der Box.
  65. X
  66. X-  In mb-daemon.c gibt die Finktion scan() nur char zurueck! Geaendert auf
  67. X   char *scan(), da ein String zurueckgegeben wird.
  68. X
  69. X-  In bled.c, HILFE wird jetzt im Makefile definiert.
  70. X
  71. X-  File portinfo.c, bei ps musz leider anstatt "ps a", "ps -a" angegeben
  72. X   werden. Kann jetzt per #define in mbox.h definiert werden.
  73. X   Wenn ich <defunkt> Prozesse habe, geht das aber auch noch nicht richtig.
  74. X
  75. X-  If's auf File-Zeiger von 0 nach NULL geaendert. Ich hoffe ich habe alle
  76. X   gefunden.
  77. X
  78. X---------------------------------------------------------------------------
  79. X
  80. XSun Nov 17 09:02:12 CET 1991, Volker Schuermann <volkers@unnet.w.open.de>
  81. X
  82. Xix/MBox 1.6 PL1::
  83. X
  84. X-  Fataler Fehler im File xmd.c gefunden und behoben. 
  85. X   (Das Uebliche: "=" oder "==", dass ist hier die Frage ...)
  86. X
  87. X-  Ausgabe im Modus "Seitenweise ausgeben, Seitende markieren" komplett
  88. X   ueberarbeitet. Diese Aenderung bezieht sich auf show.c, portinfo.c,
  89. X   tools.c, misc2.c, misc.c und lesen2.c.
  90. X
  91. X-  Hergo's Makefile fast komplett uebernommen - leider ist MINIXens
  92. X   MAKE etwas umstaendlicher, desshalb musste 'ne kleinere Aenderung
  93. X   gemacht werden.
  94. X
  95. X-  Die Geschichte mit "ps -a" wird generell so gefahren, denn auch
  96. X   MINIX kennt diese Flagge. 
  97. X
  98. X---------------------------------------------------------------------------
  99. X
  100. XWed Nov 20 17:02:12 CET 1991, Volker Schuermann <volkers@unnet.w.open.de>
  101. X
  102. Xix/MBox 1.6 PL2::
  103. X
  104. X-  Im Makefile gab's noch ein paar Unstimmigkeiten .... jetzt gibt's
  105. X   ein paar weniger :-)
  106. X
  107. X-  Fuer den Fall das die Datei UDBASE (siehe mbox.h) nicht existiert,
  108. X   richtet die MBox automagisch eine Userdatenbank ein, die den 
  109. X   Definitionen in mbox.h angepasst wird.
  110. X
  111. X-  In admin.c war eine Forward Deklaration nicht zulaessig.
  112. X
  113. X-  Die SYSV-Version hatte den "nnpost" nicht im Griff. Dieses Problem
  114. X   ist jetzt behoben - allerdings werden Subject, Keywords und Summary
  115. X   mit "No xxxx." gefuellt wenn sie nicht definiert vom User definiert
  116. X   wurden.
  117. X
  118. X---------------------------------------------------------------------------
  119. X
  120. XSat Nov 23 16:22:24 MEZ 1991, Hergo Pape <hergo@ivcmd.Boerde.DE>
  121. X
  122. Xix/MBox 1.6 PL3::
  123. X
  124. X -  In coreleft.c noch ein "#include <malloc.h> eingefuegt, sonst kommt
  125. X    bei malloc() ein Warning.
  126. X -  Im Makefile ist weiterl.c angegeben! habe das File weiterleiten.c
  127. X    entsprechend umbenannt.
  128. X -  Unter ISC gibt es keine Funktion "chgrp()", das wird wie bei SYS7
  129. X    mit chown() gemacht. 
  130. X -  In bled.c wurde HILFE nochmal definiert! Habe #ifndef Klammer drum
  131. X    gesetzt.
  132. X -  In xmd.c fehlt in der Funktion main(), ganz hinten eine Klammer '}'!.
  133. X
  134. X---------------------------------------------------------------------------
  135. X
  136. XSun Nov 24 11:15:43 CET 1991, Volker Schuermann <volkers@unnet.w.open.de>
  137. X
  138. Xix/MBox 1.6 PL3::
  139. X
  140. X -  Die Flagge -D_ISC sorgt dafuer, dass auch unter Interactive UNIX
  141. X    der System Call "chown" statt "chown"&"chgrp" eingesetzt wird.
  142. X
  143. X -  Die Flagge -D_DATESTAMP gibt auf der Console (oder auf was immer
  144. X    gerade per REDIRECT umgeleitet wird) zusaetlich zu den alten MBox-
  145. X    Informatione auch Datum und Uhrzeit aus.
  146. X
  147. X---------------------------------------------------------------------------
  148. X
  149. XWed Dec 4 19:41:02 CET 1991, Volker Schuermann <volkers@unnet.w.open.de>
  150. X
  151. Xix/MBox 1.6 PL4::
  152. X
  153. X -  Die Flagge -D_SCO entspricht fast komplett -D_ISC. Allerdings wird
  154. X    die Definition der ENTER Taste bei -D_SCO zusaetzlich beeinflusst
  155. X    (ENTER = 13).
  156. X
  157. X -  Im Makefile fehlte bei PROGS die Angabe "xmd" ("mb-daemon" war doppelt
  158. X    aufgefuehrt.
  159. X
  160. X -  Die Umbenennung von "weiterleiten.c" auf "weiterl.c" bleibt auch
  161. X    weiterhin den Installateuren ueberlassen :-)
  162. X
  163. X
  164. X---------------------------------------------------------------------------
  165. X
  166. XSun Dec 8 19:41:02 CET 1991, Volker Schuermann <volkers@unnet.w.open.de>
  167. X
  168. Xix/MBox 1.6 PL4::
  169. X
  170. X -  Da die MBox ab sofort komplett auf RMAIL und INEWS aufsetzt, gibt's
  171. X    ein paar GROESSERE Aenderungen:
  172. X
  173. X    Die Modi SYS_ACCOUNT und HDB_UUCP wurden komplett deaktiviert.
  174. X
  175. X    Die Kommunikation mit RMAIL, INEWS und SMAIL (?) laeuft ueber drei
  176. X    Shell-Scripts: $MBOXHOME/etc/rmail.sh, ~/etc/inews.sh und ~/etc/alias.sh
  177. X
  178. X -  Bisher habe ich es nicht fertig gebracht auf SETUID "root" zu verzichten.    
  179. X    Auch nach der Umstellung auf RMAIL/INEWS laufen MB-DAEMON und MBOX
  180. X    nur mit "root"-Permissions fehlerfrei.
  181. X
  182. X---------------------------------------------------------------------------
  183. X
  184. XSat Dec 28 18:11:41 CET 1991, Volker Schuermann <volkers@unnet.w.open.de>
  185. X
  186. Xix/MBox 1.6e PL5::
  187. X    
  188. X -  Alle Text-Zeilen im Source-Code der ix/MBox wurden entfernt und durch
  189. X    #DEFINES ersetzt. Diese Defines koennen ueber das "Language-File"
  190. X    [mbox.msg] belegt werde.
  191. X
  192. X -  Die Dateien [help.befehle], [help.hilfe] und [help.shorthelp] liegen
  193. X    in englischen Versionen vor. Das gilt auch fuer die Dokumentation.
  194. X
  195. X -  Verschiedene Fehler in "lesen2.c" und "admin.c" wurden behoben. Ausserdem
  196. X    wird neue Post auch direkt beim Anmelden angekuendigt. 
  197. X
  198. X
  199. X---------------------------------------------------------------------------
  200. X
  201. XWed Jan 1 11:11:11 CET 1992, Volker Schuermann <volkers@unnet.w.open.de>
  202. X
  203. Xix/MBox 1.6 PL6::
  204. X
  205. X -  Probleme mit "ifdef XXX || XXX" in [defs.h] und [getline.c] geloest.
  206. X
  207. X -  Der XMD wertet nur noch das erste Auftreten von "From:" und "Subject:"
  208. X    aus. Bei "From" (aus dem Envelope) gibt's 'ne Sonderregelung. 
  209. X
  210. X---------------------------------------------------------------------------
  211. X
  212. XWed Jan 4 22:31:51 CET 1992, Volker Schuermann <volkers@unnet.w.open.de>
  213. X
  214. Xix/MBox 1.6 PL6::
  215. X
  216. X -  Befehl "Suchen" testweise implementiert. Er setzt auf GREP auf.
  217. X
  218. X -  Die Header von MAIL und NEWS koennen editiert werden. "Followup" und
  219. X    "Poster" werden erkannt und ausgewertet.
  220. X
  221. X---------------------------------------------------------------------------
  222. X
  223. XTue Feb 17 21:02:32 CET 1992, Volker Schuermann <volkers@unnet.w.open.DE>
  224. X
  225. Xix/MBox 1.6 PL8.7::
  226. X
  227. X -  Befehl "User" erweitert: Informationen ueber lokale User aus der
  228. X    Userdatenbank, oder per "uux" von anderen Sites.
  229. X
  230. X -  Sicherheitslecks in "postfach.c" und "admin.c" gefunden und entschaerft.
  231. X
  232. X -  Header werden generell <intensive> ausgegeben.
  233. X
  234. X -  Funktion "Download" bietet die Option mehrer Dateien mit einem
  235. X    Kommando zu uebertragen.
  236. X
  237. X -  Funktion "Statistik #" zeigt zusaetlich die Ausnutzung der Baudrate
  238. X    in Prozent an.
  239. X
  240. X -  Befehl "Statistik %" errechnet eine HITLISTE aus der Liste der
  241. X    Downloads.
  242. X
  243. X -  Erfassung in "postfach.c" und "admin.c" erlaubt keine Sonderzeichen
  244. X    in Name, Nick/Alias und Shell-Name.
  245. X
  246. X -  XMD verfuegt ueber eine XMD.ALIAS-Datei, in der Empfaenger-Adressen
  247. X    lokal umgeleitet werden koennen.
  248. X
  249. X -  Das Makefile wurde ERHEBLICH verbessert!
  250. X
  251. X -  Die INDEX-Files muessen nicht mehr global fuer alle Gruppen im
  252. X    voraus gebildet werden, sondern koennen auch online von der MBox
  253. X    gruppenweise erstellt werden.
  254. END_OF_FILE
  255.   if test 8260 -ne `wc -c <'Changelog'`; then
  256.     echo shar: \"'Changelog'\" unpacked with wrong size!
  257.   fi
  258.   # end of 'Changelog'
  259. fi
  260. if test -f 'TUTORIAL' -a "${1}" != "-c" ; then 
  261.   echo shar: Will not clobber existing file \"'TUTORIAL'\"
  262. else
  263.   echo shar: Extracting \"'TUTORIAL'\" \(10956 characters\)
  264.   sed "s/^X//" >'TUTORIAL' <<'END_OF_FILE'
  265. X
  266. X
  267. X
  268. X
  269. X
  270. X
  271. X
  272. X
  273. X
  274. X            ix/MBox BETA-Test Version
  275. X          Mailbox-Programm fuer UNIX(-Derivate)
  276. X            
  277. X               Volker Schuermann
  278. X              Wuppertal, FRG, 08.12.1991
  279. X
  280. X
  281. X
  282. X
  283. X
  284. X
  285. X
  286. X
  287. X
  288. X
  289. X
  290. X
  291. X          INHALT (Tutorial Beta-Entwurf (internal use only !))
  292. X=============================================================================
  293. X
  294. X    1.  ALLGEMEINES
  295. X
  296. X    1.1.  Public Domain ?!
  297. X    1.2.  Struktur der Programme
  298. X
  299. X    2.  UMGEBUNG (Voraussetzungen)
  300. X
  301. X    2.1.  Fuer alle
  302. X    2.2.  Speziell fuer Minix
  303. X
  304. X    3.  INSTALLATION
  305. X
  306. X    3.1.  Anpassungen "mbox.h"
  307. X    3.2.  Anpassungen "mb-daemon.c"
  308. X    3.3.  Anpassungen "/usr/lib/crontab"
  309. X    3.4.  Anpassungen "/etc/passwd"
  310. X    3.5.  Die Verteilung der Rechte
  311. X    3.6.  Kommunikation mit RMAIL & INEWS
  312. X
  313. X    4.  VERWALTUNG
  314. X    
  315. X    4.1.  der Teilnehmer (Bitte VOR dem ersten Aufruf der MBox lesen !)
  316. X    4.2.  der Dateien
  317. X
  318. X    5.  WEITERE INFOS
  319. X    
  320. X    5.1.  Mail genuegt
  321. X    5.2.  Updates
  322. X
  323. X
  324. X
  325. X
  326. X
  327. X
  328. X1. ALLGEMEIN
  329. X=============================================================================
  330. X
  331. X1.1.  Public Domain ?!
  332. X======================
  333. X
  334. XDas gesammte Programmpaket darf beliebig oft weitergegeben und eingesetzt
  335. Xwerden. 
  336. X
  337. XEs duerfen keine veraenderten Versionen verbreitet werden. Jede Veraenderung
  338. Xmuss dem Autor als ASCII-Textfile uebermittelt werden. Er entscheidet, ob
  339. Xdie Veraenderung in die naechste Version aufgenommen wird.
  340. X
  341. XDie Routine "getch.c" stammt nicht vom Autor, sondern von "attron!chris" !
  342. X
  343. X
  344. X
  345. X1.2. Struktur der Programme
  346. X===========================
  347. X
  348. XMir ist voellig klar, 
  349. X
  350. X... dass jeder die Routinen der "ix/MBox" effizienter, 
  351. Xstrukturierter und "besser" schreiben koennte. 
  352. X
  353. X... dass GOTOs und globale Varibalen nicht unbedingt zum
  354. XHandwerkszeug eine C-Programmierers gehoehren sollten.
  355. X
  356. X... dass viele Routinen aussehen, als waeren sie schnell
  357. X"ins Unreine" geschrieben worden - bei etlichen trifft das zu.
  358. X
  359. X... dass keine der Routinen einem LINT standhalten koennte.
  360. X
  361. X... dass jeder, der diese Punkte bemaengelt, selbst zu faul 
  362. Xwar, eine MBox auf die Beine zu stellen ...
  363. X
  364. X
  365. X
  366. X
  367. X2. UMGEBUNG
  368. X=============================================================================
  369. X
  370. X2.1. Fuer alle
  371. X==============
  372. XFolgende Programme MUESSEN bereits auf dem Host-Rechner installiert und
  373. Xeinsatzfaehig sein:
  374. X
  375. X- UUCP (UUCICO, UUX, UUXQT, ...)  
  376. X
  377. X- NEWS (RNEWS, PNEWS, EXPIRE, NNPOST, ...)
  378. X
  379. X- MAIL (LMAIL)
  380. X
  381. X- UMAIL (SENDMAIL, SMAIL etc.)
  382. X
  383. XDie MBox setzt auf dieser Programm-Konstellation auf. Sie ist nicht ein-
  384. Xsatzfaehig, wenn eines der Programm nicht verfuegbar ist.
  385. X
  386. X
  387. X
  388. X2.2. Speziell fuer Minix
  389. X========================
  390. XDie MBox wurde entwickelt unter MINIX 1.5.10 ... folgenden Patches muessen
  391. Xbei dieser Version angewendet werden:
  392. X
  393. X- Bruce Evans MX386-Patches
  394. X
  395. XVorteilhaft aber nicht zwingend erforderlich:
  396. X
  397. X- Gordon Irlams VC (virtuelle Consolen)
  398. X
  399. X- Shoelace (zum Booten von Harddisk)
  400. X
  401. XDie "ix/MBox" laeuft NICHT im 64+64 Modus, sondern nur unter 386er MINIX !
  402. XWie's bei 68000er MINIX aussieht, ist bisher nicht geprueft worden.
  403. X
  404. X
  405. X
  406. X3. INSTALLATION
  407. X=============================================================================
  408. X
  409. X3.1. Anpassungen ("mbox.h")
  410. X===========================
  411. XDie Datei "mbox.h" enthaelt die wichtigsten system-spezifischen Parameter.
  412. XDiese Parameter MUESSEN (zum Teil) unbedingt angepasst werden. 
  413. X
  414. XDie einzelnen Eintraege sind in der Datei dokumentiert - Fehler bei der
  415. XAnpassung ziehen WEITE Kreise ... VORSICHT ist die Mutter der Porzellankiste.
  416. X
  417. XPfade, deren Definition mit "./" beginnen, beziehen sich auf die MBox und 
  418. Xderen HOME-Verzeichnis. Diese Pfade muessen/sollten NICHT geandert werden.
  419. X
  420. XDas gilt praktisch fuer alle Definitionen, die nicht durch ein vorangestelltes
  421. X">" kenntlich gemacht wurden.
  422. X
  423. XZusaetzlich enthalten die verschiedenen Programme jeweils eigene Parameter-
  424. XDefinitionen. Deren Bedeutung wird im Folgenden erklaert.
  425. X
  426. X
  427. X3.2. Anpassungen "mb-daemon.c"
  428. X==============================
  429. XDer MB-Daemon kann u.A. auch als Reflektor fuer eine NewsGroup (NG) fungieren.
  430. XDa er sich nicht an die Konventionen fuer Reflektoren haelt, sollte sein
  431. XEinsatz auf lokal NGs beschraenkt bleiben.
  432. X
  433. XREFLECT_NG        Diese NG wird vom Reflektor untersucht und beantwortet
  434. XREFLECT_LOG       Hier protokolliert der Reflector seine Aktionen
  435. XDIRLIST           Mit dieser Datei wird ein DIRLIST-Request beantwortet
  436. XREFLECTUID        UID des Users "reflector" ... siehe "/etc/passwd"
  437. X
  438. XSoll der Reflektor inaktiv bleiben, genuegt es die REFLECT_NG auf eine NG
  439. Xzu setzen, die nicht existiert (NICHT "", sondern z.B. "dummy.dummy".
  440. X
  441. X
  442. X
  443. X
  444. X3.3. Anpassungen "/usr/lib/crontab"
  445. X===================================
  446. XDie CRONTAB muss um 2 Eintraege erweitert werden. Entscheidend ist dabei
  447. Xdie chronologische Reihenfolge:
  448. X
  449. X  0   4         *   *   *   /usr/lib/news/sendbatch -c NEWSFEED
  450. X 30   5         *   *   *   /usr/lib/uucp/uucico -r1 -x2 -sNEWSFEED
  451. X  0   6         *   *   *   /usr/lib/news/rnews -U
  452. X 20   6         *   *   *   /usr/bin/mb-daemon
  453. X 40   6         *   *   *   /usr/bin/xmd
  454. X
  455. XMB-Daemon und XMD duerfen erst aktiv werden, nachdem die NEWS einsortiert
  456. Xsind. Wird als Mailer SMAIL verwendet, entfaellt der Aufruf des XMD.
  457. X
  458. X
  459. X3.4. Anpassung der "/etc/passwd"
  460. X================================
  461. XDie PASSWD-Datei sollte um den Eintrag "gast" erweitert werden. Meldet
  462. Xsich dieser User an, wird direkt die "ix/MBox" gestartet.
  463. XEin Verlassen den MBox ist damit gleichbedeutend mit einem Verlassen des
  464. XSystems !
  465. X
  466. Xgast::12:1:Mailbox-User:/usr/gast:/usr/bin/mbox
  467. Xvolkers:X:14:3:Volker Schuermann:/usr/volkers/bin/shh
  468. Xreflector:*:22:3:UnNet Reflector::
  469. Xnews:*:30:6:W-NEWS System:/usr/lib/news:
  470. Xusenet:*:31:6:W-NEWS Administrator:/usr/lib/news: 
  471. Xuucp::40:40:UUCP-Account on Un.Net:/usr/spool/uucp:
  472. Xpostmaster:*:41:40:UUCP-Erroruser:/usr/spool/uucp:/bin/sh
  473. Xnuucp::42:40:Anonymous-UUCP:/usr/spool/uucppublic:/usr/lib/uucp/uucico
  474. X
  475. XDie Gruppe des Users "gast" und die Gruppe der uebrigen User (z.B. "volkers")
  476. Xmuss unterschiedlich sein (GID !)
  477. X
  478. X
  479. X
  480. X3.5. Die Verteilung der Rechte
  481. X==============================
  482. XHier nun eine Uebersicht der versch. Pfade und Programme (wobei das HOME-
  483. XVerzeichnis der "ix/MBox" jetzt "/usr/mbox" genannt wird):
  484. X
  485. Xdrwxrwxrwx  root.root /usr/mbox
  486. X-r-xr-xr-x  root.root /usr/mbox/mbrsh
  487. X
  488. Xdrwxrwx---  root.root  /usr/mbox/etc
  489. X-rw-rw----  root.root  /usr/mbox/etc/*
  490. X-rwxrwx---  root.root  /usr/mbox/etc/tset
  491. X
  492. Xdrwxrwx---  root.root  /usr/mbox/lib
  493. X-rw-rw-rw-  root.root  /usr/mbox/lib/*
  494. X
  495. Xdrwx------  root.root  /usr/mbox/src
  496. X-rw-r--r--  root.root  /usr/mbox/src/*
  497. X
  498. Xdrwxrwx---  root.root  /usr/mbox/usr
  499. Xdrwxrwx---  root.root  /usr/mbox/usr/*
  500. X-rw-rw----  root.root  /usr/mbox/usr/*/*
  501. X
  502. X-rwsrwsr-x  root.root  /usr/bin/mbox
  503. X-rwxrwxr-x  bin.sys    /usr/bin/bled
  504. X-rwxrwxr-x  root.root  /usr/bin/xmd
  505. X-rwsrwsr-x  root.root  /usr/bin/mb-daemon
  506. X
  507. X
  508. X3.6. Kommunikation mit RMAIL & INEWS
  509. X====================================
  510. XMit der Version 1.6 PL4 wird eine voellig neue Struktur der Kommunikation
  511. Xzwischen ix/MBox und UNIX/MINIX eingefuehrt. Sowohl Mails als auch Artikel
  512. Xfuer NEWS werden von der MBox mit einem Header ausgestattet und an die
  513. XProgramme RMAIL bzw. INEWS uebergeben, die den Header komplettieren und
  514. Xdie MSG verschicken.
  515. X
  516. XDurchgefuehrt werden diese Aktion mit Hilfe von 2 (3) Shell-Scripts. Sie
  517. Xbefinden sich in "/usr/mbox/etc/rmail.sh", "/usr/mbox/etc/inews.sh" und
  518. X"/usr/mbox/etc/alias.sh". Das letzte Script wird immer dann aufgerufen,
  519. Xwenn ein neues Postfach angelegt wird. Es sollte dann eine Zeile an die Datei
  520. X"/usr/lib/smail/aliases" (Alias-Datei von SMAIL) angehaengt werden, die
  521. XSMAIL anweist den Usernamen "Vorname.Name" als Alias zu verstehen und das
  522. Xentsprechende Kommando ("xmd Vorname.Name") auszufuehren ...
  523. X
  524. X
  525. X
  526. X
  527. X4. VERWALTUNG
  528. X=============================================================================
  529. X
  530. X4.1. Teilnehmer
  531. X===============
  532. XDie "ix/MBox" benutzt den Befehl "admin" zur Pflege der Teilnehmerdaten-
  533. Xbank. Der Sysop/Postmaster/Administrator kann hier auf alle Eintraege
  534. Xzugreifen. 
  535. X
  536. XUm die Sysop-Berechtigung zu bekommen, muss der Postmaster sich als "root"
  537. Xins System einloggen, und dann per "mbox" die MBox aufrufen. Er erhaelt
  538. Xdann Userlevel 10 und ist damit berechtigt, das Kommando "admin" auszu-
  539. Xfuehren. Sollte das mal nicht funktionieren, kann man einfach das Level
  540. Xfuer "admin" in der Datei "/usr/mbox/etc/help.befehle" auf 0 setzen ...
  541. X
  542. XACHTUNG: damit hat JEDER Zugriff auf alle Teilnehmerdaten - also nach
  543. XErhoehung des eigenen Levels (auf 10) unbedingt das "admin"-Level wieder
  544. Xauf 9 zuruecksetzen !!!
  545. X
  546. X
  547. XNochmal ACHTUNG: Zwei User muessen unbedingt ins System eingetragen werden:
  548. X
  549. XUsername:   GAST (identisch mit der GUEST-Definition in "mbox.h")
  550. XSH-Account: gast (siehe "/etc/passwd");
  551. XUser-Level: 0
  552. X
  553. XUsername:   Jacke wie Hose (naja...)
  554. XSH-Account: root (siehe POSTMASTER-Definition in "mbox.h");
  555. XUser-Level: 10
  556. X
  557. XSolange diese beiden User nicht ordnungsgemaess eingetragen sind, laeuft
  558. Xdas System nicht !!!
  559. X
  560. X
  561. XWird die MBox gestartet, und die Datei UDBASE (siehe "mbox.h") existiert
  562. Xnoch nicht, erzeugt die MBox eine Userdatenbank aus den Definitionen in
  563. X"mbox.h" - diese Datenbank kann mit dem Befehl "admin" ueberarbeitet werden.
  564. X
  565. XScheint das zu aufwendig, muessen die Definitionen in "mbox.h" geaendert und
  566. Xdie Datei UDBASE geloescht werden. Beim naechsten Start der MBox wird
  567. Xerneute eine Datenbank angelegt.
  568. X
  569. X
  570. X
  571. XWICHTIG: Fuer Gaeste und User muss es verschiedene GIDs (GroupIDs) auf
  572. XShell-Ebene geben !!! MBox-User OHNE Shell-Account werden daran erkannt,
  573. Xdass ihre GID die der SH-Gaeste (z.b. "other") ist ... MBox-User MIT Shell-
  574. XAccount haben die GID der SH-User (z.B. "sys"). 
  575. X
  576. X
  577. X
  578. X4.2. Dateien
  579. X============
  580. XDa es sich bei allen Protokoll- und Steuerdateien um ASCII-Textfiles handelt,
  581. Xkoennen Aenderungen problemlos mit einem "normalen" Editor vorgenommen werden.
  582. X
  583. XDie einzige Ausnahme bildet die Teilnehmer-Datenbank - also HAENDE WEG !!!
  584. X
  585. XSoll sich die MBox mit einem "LOGO"-Text/Bild melden, muss die Datei 
  586. X"./etc/logo" (s. LOGO-Definition in "mbox.h") exisitieren. Diese Datei 
  587. Xenthaelt einen ASCII-Text. ANSI-Bilder sollten vermieden werden, denn sie
  588. Xumgehen die TERMCAP-Steuerung der MBox.
  589. X
  590. X
  591. X5. WEITERE INFOS
  592. X=============================================================================
  593. X
  594. X5.1. Mail genuegt
  595. X=================
  596. XDiese BETA-Version des TUTORIALS beantwortet natuerlich nicht alle Fragen,
  597. Xdie bei der Installation der "ix/MBox" auftreten werden, aber bei zusaetz-
  598. Xlichem Studium der einzelnen Routinen (siehe auch CROSSREF), sollte sich
  599. Xzu fast jedem Problem auch eine Loesung finden lassen.
  600. X
  601. XWenn alles fehlschlaegt, genuegt eine MAIL an "volkers@unnet.w.open.de",
  602. Xum Infos und evtl. neue Routinen zu bekommen. Ausserdem wird immer dann,
  603. Xwenn's neue Erkenntnisse gibt, ein INFO-Rundschreiben verschickt, um 
  604. Xalle MBox-Betrieber mit dem aktuellen Stand der Entwicklung vertraut
  605. Xzu machen.
  606. X
  607. X
  608. X5.2. Updates
  609. X============
  610. XUpdates werden als CDIFFs fuer die Version 1.6.0 der ix/MBox verschickt,
  611. Xoder auf Wunsch als komplette Source-Files. Ausserdem werden von Zeit zu
  612. XZeit INFO-Runschreiben verschickt, die auf Aenderungen aufmerksam machen.
  613. X
  614. X
  615. XDer Rest ist Glueckssache ... mfG Volker Schuermann
  616. END_OF_FILE
  617.   if test 10956 -ne `wc -c <'TUTORIAL'`; then
  618.     echo shar: \"'TUTORIAL'\" unpacked with wrong size!
  619.   fi
  620.   # end of 'TUTORIAL'
  621. fi
  622. if test -f 'etc/english.hilfe' -a "${1}" != "-c" ; then 
  623.   echo shar: Will not clobber existing file \"'etc/english.hilfe'\"
  624. else
  625.   echo shar: Extracting \"'etc/english.hilfe'\" \(9576 characters\)
  626.   sed "s/^X//" >'etc/english.hilfe' <<'END_OF_FILE'
  627. X#?
  628. XCommand: "?"
  629. X
  630. XYou'll get a list of all commands, which you may use. The contents of this
  631. Xlist depends on your user-level. Type "? *", if you like to see ALL commands
  632. Xof this BBS.
  633. X
  634. X#0
  635. XCommand: "0" ("1-9")
  636. X
  637. XThere is a "dynamic command buffer", who captures every input you type at
  638. Xthe command-prompt. Type "0" to see which commands are in buffer, or any
  639. Xnumber between 1 and 9 to execute one of those commands. Of course, you may
  640. Xuse the cursor-keys to select any command, too.
  641. X
  642. X#+
  643. XCommand: "+"
  644. X
  645. XJump to the next board with new articles.
  646. X
  647. X#-
  648. XCommand: "-"
  649. XJump to the previous board with new articles.
  650. X
  651. X#ACCOUNT
  652. XCommand: "Account"
  653. X
  654. XYou need to registered to send and receive mails to/from all over the
  655. Xworld. The registration makes you a fully accepted user of this BBS.
  656. XYou're now reachable by mail from users on this host or on any host, this
  657. Xhost is connected to.
  658. X
  659. XPLEASE use your full name as username !
  660. X
  661. X#BOARD
  662. XCommand: "Board"
  663. X
  664. XThere is a board for every single subject/theme with it's own index. So you
  665. Xhadn't to search long for special information on any item. To move from one
  666. Xboard to another, you use the command "board" with some options:
  667. X
  668. XBOARD                      list boards with new articles
  669. XBOARD *                    list ALL boards
  670. XBOARD +                    go to the next board
  671. XBOARD -                    go to the previous board
  672. XBOARD !                    display the name of the current board
  673. XBOARD #                    list areas in board
  674. XBOARD ..           step from one area to the previous one
  675. XBOARD boardname            jump to board "boardname"
  676. X
  677. X#CHAT
  678. XCommand: "Chat"
  679. X
  680. X- systemdepending stuff -
  681. X
  682. X#DATE
  683. XCommand: "Date"
  684. X
  685. XShows the current date. (Not quite right ... it's shows the systems date :-)
  686. X
  687. X#DELETE
  688. XCommand: "Delete"
  689. X
  690. XDelete mails or articles. NOTE: Be careful! If you type "delete" in your
  691. XPM, every (!) mail will be scratched!
  692. X
  693. XDELETE               delete all your mail
  694. XDELETE article           delete article no. "article"
  695. XDELETE article-article       delete from "article" to "article"
  696. X
  697. X#DIR
  698. XCommand: "Dir"
  699. X
  700. XThis will give you a survey of what subjects are collect in the current
  701. Xboard. If you hadn't add a '*', you'll ony see the entries which are
  702. Xnew for you.
  703. X
  704. XDIR                        index new articles
  705. XDIR *                      index ALL articles (of a board)
  706. X
  707. X#DIRECTION
  708. XCommand: "Direction"
  709. X
  710. XIt's sounds pretty funny, but this commands decides whether you see
  711. Xanswers before questions or not :-)
  712. X
  713. X#FORWARD
  714. XCommand: "Forward"
  715. X
  716. XIf you like to send copies of mails/articles to other users, you may use
  717. Xthis command. The variable "user" (see below) stand for every kind of
  718. Xaddress (i.e. "Prename.Name", "host!name", "name@host.domain" etc.). So
  719. Xit is possible to forward articles to your own shell-account on this host,
  720. Xor to your account on any other host ... this may be useful sometimes.
  721. X
  722. XFORWARD                    list stored mails
  723. XFORWARD user               forward a stored mail to "user"
  724. XFORWARD mail user          forward "mail" to "user"
  725. XFORWARD article user       forward "article" to "user"
  726. X
  727. X#GAMES
  728. XCommand: "Games"
  729. X
  730. XThe list, that will be shown if you enter this command, includes some
  731. Xgames you may play. They all have own accounting procedures and different
  732. Xinstruction sets ... so don't blame the sysop for anything that will
  733. Xhappen to you :-)
  734. X
  735. X#GOODBYE
  736. XCommand: "Goodbye"
  737. X
  738. XNEVER use this command! (Exception: If you REALLY want to leave :-)
  739. X
  740. X#HELP
  741. XCommand: "Help"
  742. X
  743. XYou managed to get this information ... so why do you ask ???
  744. X
  745. XHELP                       this shorthelp
  746. XHELP *                     display some pages of helpful descriptions
  747. XHELP command               show information on "command"
  748. X
  749. X#MAIL
  750. XCommand: "Mail"
  751. X
  752. XOne of the most powerful commands on this BBS. If you are fitted out with
  753. Xthe right user-level, you're able to send mails to receivers all over the
  754. Xworld ... or just to another BBS-user.
  755. X
  756. XMAIL Prename.Name          (Prename.Name i.e. "Volker.Schuermann")
  757. XMAIL Alias                 (Alias i.e. "Sysop")
  758. XMAIL Shell-Account         (Shell-Account i.e. "volkers")
  759. X
  760. XThese three commands will deliver a mail to a user on this host. If this user
  761. Xhas his own BBS-account, the mail will be sent to his BBS-maildrop. 
  762. XOtherwise his/her shell-account-maildrop will be filled ... 
  763. X
  764. XMAIL Host!User             (Host!User i.e. "unnet!Volker.Schuermann")
  765. XMAIL User@Host.Domain      (User@Host.Domain i.e. "volker@unnet.w.open.de")
  766. X
  767. XBoth commands will send the mail to a user on another host (if "host" or
  768. X"host@domain" are the address of this host, the mail won't leave this host).
  769. X
  770. X#MACRO
  771. XCommand: "Macro"
  772. X
  773. XFor all lazy/intelligent users, here is a way to simplify work! Just create
  774. Xa new command to collect a group of commands:
  775. X
  776. Xnew = b comp.os.minix, d, key, b sub.os.minix, b
  777. X
  778. XThe new command "new" will jump to board "comp.os.minix" and show the index
  779. Xof new articels. If you hit (the) any key, it moves to "sub.os.minix" and 
  780. Xdoes the same.
  781. X
  782. XMacro = Command Sequence
  783. X===========================================================================
  784. Xandi  = mail andreas@xenox.ruhr.de
  785. Xwalt  = mail Walter, forward weller!walterb
  786. Xgrp   = mail volkers, forw xenox, forw stefans, forw joergg
  787. Xsts   = mail Stefan S, forw stefans@coduck.ruhr.sub.org, forw unnet!stefans
  788. Xin    = +, dir, KEY, in
  789. Xpp    = PORTINFO, SLEEP 5, pp
  790. X
  791. XThe entries "in" and "pp" are demonstrating how to build recursive commands.
  792. XUse CTRL-X to break the run of such a command sequence!
  793. X
  794. X#MESSAGE
  795. XCommand: "Message"
  796. X
  797. XYou may use this text to inform other users that you're offline for a
  798. Xfew days or that you never answers mail or what ever ...
  799. X
  800. XThis text is shown to everybody who wants to send a mail to you on this
  801. Xhost.
  802. X
  803. X#MINIX
  804. XCommand: "Minix"
  805. X
  806. XIf you'd have to leave the BBS everytime you like to do something on
  807. Xshell-level, it would be a nice swapping around on this system. But with
  808. Xthe command "minix", you can do everything (even start the BBS :-) without
  809. Xleaving ... 
  810. X
  811. X#PORTINFO
  812. XCommand: "Portinfo"
  813. X
  814. XHave a look on what the other users are doing. This includes BBS-users
  815. Xas well as shell-only-users (poor guys :-)
  816. X
  817. X#PROTOCOL
  818. XCommand: "Protocol"
  819. X
  820. XSee WHO called in WHEN from WHERE on WHICH line ... puhh, but that's exactly
  821. Xwhat this command is doing.
  822. X
  823. XIf you use the option "#" (means "protocol #"), the informations are shown
  824. Xas a diagram (for statistics purposes). 
  825. X
  826. X#PM
  827. XCommand: "PM"
  828. X
  829. XMove to the board with your BBS-maildrop. There you may check your incomming
  830. Xmails and answer (reply) them.
  831. X
  832. X#READ
  833. XCommand: "Read"
  834. X
  835. XThat's how to get the information hidden behind the subjects ... the options
  836. Xto this command a described in the following:
  837. X
  838. XREAD                       read NEW articles
  839. XREAD *                     real ALL articles (of a board)
  840. XREAD article               show article no. "article"
  841. XREAD article-article       display from "article" to "article"
  842. X
  843. XThe line "READ article" builds an exceptions ... if the listing of the
  844. Xspecified article is complete, the BBS shows a little menu to you. Type
  845. Xa "?" at the prompt to see what actions are available there!
  846. X
  847. XUsing this form of the command "read" is the most convenient way to consume
  848. Xarticles!!! 
  849. X
  850. X#SETUP
  851. XCommand: "Setup"
  852. X
  853. XTo make life easier (especially YOUR life), you may change lot's of the
  854. XBBS depending paramaters. The SETUP is fully controlled by menu, so you
  855. Xonly have to hit keys (more or less astonished because of the features 
  856. Xyou never noticed before) ...
  857. X
  858. X#SIGNATURE
  859. XCommand: "Signature"
  860. X
  861. XUse this command to create a text, that will be sent as a footnote of every
  862. Xmail/article you'll write on this BBS. Have a look on the ".signatures"
  863. Xof other ppl. to see which facts belong to such a text ...  
  864. X
  865. X#STATE
  866. XCommand: "State"
  867. X
  868. XGives a summary of all data, this BBS has stored in it's accouting database.
  869. XOf course,only that part of data is shown, that belongs to you!
  870. X
  871. X#STATISTICS
  872. XCommand: "Statistics"
  873. X
  874. XThe BBS collects some information for statistics purpose. If you are inter-
  875. Xested in those statistics, use one of the following options:
  876. X
  877. XSTATISTICS                 table containing NEWS-statistics
  878. XSTATISTICS *               table containing more NEWS-statistics
  879. XSTATISTICS $               UUCP-rates (only if UUCP supports this)
  880. XSTATISTICS #               download-statistics 
  881. X
  882. XThe option "$" depends on the systems UUCP-Support. Ask your Sysop whether
  883. Xthis system accounts UUCP-Rates or not.
  884. X
  885. X#TIME
  886. XCommand: "Time"
  887. X
  888. XShows the system time and the time you're online in seconds ... my goodness,
  889. Xfive hours, and still online ...
  890. X
  891. X#USERS
  892. XCommand: "Users"
  893. X
  894. XYep, you're not alone on this host. To see who's on too, type one of the
  895. Xfollowing commands:
  896. X
  897. XUSERS                      show users list
  898. XUSERS *                    show users list (more detailed)
  899. XUSERS #                    users up-/download ratio
  900. X
  901. XIf your level is to low, you won't be able to use the "#" option - don't
  902. Xbe angry, it's not as much interesting, as it seems to be (use "stati #"
  903. Xinstead :-)
  904. X
  905. X#VERSION
  906. XCommand: "Version"
  907. X
  908. XThis option was built in for other Sysops only - they may use it to spy out
  909. Xwhich BBS is the older one - nothing else.
  910. X
  911. XVERSION                    print version
  912. XVERSION *                  display compiling definitions
  913. XVERSION #                  the "Hall of Fame"
  914. X
  915. XThe option "#" gives a list of ppl., who were members of the "BBS gold crew"
  916. Xduring it's development :-)
  917. X
  918. X#WRITE
  919. XCommand: "Write"
  920. X
  921. XUse this command to create a new article for any board or newsgroup on this
  922. XBBS. Depending on your user-level this article will be sent with distribution
  923. X"world", "*group*" or "local". 
  924. X
  925. XDon't use this command to send mails to other users ... try it, if you don't
  926. Xtrust in documentations. 
  927. END_OF_FILE
  928.   if test 9576 -ne `wc -c <'etc/english.hilfe'`; then
  929.     echo shar: \"'etc/english.hilfe'\" unpacked with wrong size!
  930.   fi
  931.   # end of 'etc/english.hilfe'
  932. fi
  933. if test -f 'src/bled.c' -a "${1}" != "-c" ; then 
  934.   echo shar: Will not clobber existing file \"'src/bled.c'\"
  935. else
  936.   echo shar: Extracting \"'src/bled.c'\" \(11258 characters\)
  937.   sed "s/^X//" >'src/bled.c' <<'END_OF_FILE'
  938. X#include <stdio.h>
  939. X#include <setjmp.h>
  940. X#include <signal.h>
  941. X
  942. X#define VERSION "LED 3.4 (Unix)"
  943. X#define AUTOR   "Volker.Schuermann@unnet.w.open.de"
  944. X
  945. X#ifndef STRING
  946. X#define STRING 85
  947. X#endif
  948. X
  949. X#include "mbox.msg"
  950. X
  951. X
  952. X#define CR     13
  953. X#define LF     10
  954. X#define BS      8
  955. X#define CTRL_X 24
  956. X#define CTRL_D  4
  957. X
  958. X
  959. X#define TMP "/tmp"
  960. X
  961. X#define APPEND 1
  962. X#define INSERT 2
  963. X#define FINISH 3
  964. X#define QUIT   4
  965. X#define UPLOAD 5
  966. X
  967. X#ifdef _MBOX
  968. X#undef _MBOX
  969. X#endif
  970. X
  971. Xstatic int melted;
  972. X
  973. Xstatic char tmp1[STRING];
  974. Xstatic char tmp2[STRING];
  975. X
  976. Xstatic int von, bis;
  977. Xstatic int max_line;
  978. X
  979. Xstatic char imode;
  980. X
  981. Xstatic char THE_FILE[STRING];
  982. Xstatic int  THE_LINE;
  983. X
  984. X
  985. Xint melt(startlin)
  986. Xint startlin;
  987. X{
  988. X  FILE *fp;
  989. X  FILE *ff;
  990. X  FILE *fg;
  991. X  char s[255];
  992. X  char tmp3[STRING];
  993. X  int i;
  994. X
  995. X
  996. X  if (melted == 0) return 0;
  997. X
  998. X  sprintf(tmp3, "%s/bled3.%d", TMP, getpid());
  999. X
  1000. X  fg = fopen(tmp3, "w");
  1001. X  if (fg == NULL) {
  1002. X    printf("\n%s\n", tmp3);
  1003. X    exit(-1);
  1004. X  }
  1005. X  fp = fopen(tmp1, "r");
  1006. X  if (fp == NULL) {
  1007. X    printf("\n%s\n", tmp1);
  1008. X    exit(-1);
  1009. X  }
  1010. X  i = 0;
  1011. X  while ((i < startlin) && (fgets(s, 250, fp) != NULL)) {
  1012. X    fputs(s, fg);
  1013. X    i++;
  1014. X  }
  1015. X  ff = fopen(tmp2, "r");
  1016. X  if (ff != NULL) {
  1017. X    while (fgets(s, 250, ff) != NULL) {
  1018. X        fputs(s, fg);
  1019. X        i++;
  1020. X    }
  1021. X    fclose(ff);
  1022. X  }
  1023. X  while (fgets(s, 250, fp) != NULL) {
  1024. X    fputs(s, fg);
  1025. X  }
  1026. X  fclose(fg);
  1027. X  fclose(fp);
  1028. X
  1029. X  unlink(tmp1);
  1030. X  rename(tmp3, tmp1);
  1031. X  unlink(tmp3);
  1032. X
  1033. X  return 0;
  1034. X}
  1035. X
  1036. X
  1037. X
  1038. Xbledmove(from, to)
  1039. Xchar from[], to[];
  1040. X{
  1041. X  FILE *fp;
  1042. X  FILE *ff;
  1043. X  char s[255];
  1044. X
  1045. X
  1046. X  fp = fopen(from, "r");
  1047. X  if (fp == NULL) {
  1048. X    printf("\n%s\n", from);
  1049. X    exit(-1);
  1050. X  }
  1051. X  ff = fopen(to, "w");
  1052. X  if (ff == NULL) {
  1053. X    printf("\n%s\n", from);
  1054. X    exit(-1);
  1055. X  }
  1056. X  while (fgets(s, 250, fp) != NULL) {
  1057. X    fputs(s, ff);
  1058. X  }
  1059. X  fclose(fp);
  1060. X  fclose(ff);
  1061. X}
  1062. X
  1063. X
  1064. X
  1065. X
  1066. X
  1067. Xzeigen(mode)
  1068. Xchar mode;
  1069. X{
  1070. X  FILE *fp;
  1071. X  char t[STRING];
  1072. X  char s[255];
  1073. X  int i;
  1074. X
  1075. X  if ((von != 0) && (bis == 0)) bis = von;
  1076. X  if ((von == 0) && (bis == 0)) bis = 32000;
  1077. X
  1078. X  if (von > bis) {
  1079. X    /*
  1080. X    printf("\n\nLED: Fehler bei der Zeilenangabe.\n");
  1081. X    */    
  1082. X    printf("\n\nLED: %s\n", BLD01_MSG);
  1083. X    return;
  1084. X  }
  1085. X  fp = fopen(tmp1, "r");
  1086. X  if (fp == NULL) {
  1087. X    printf("\n%s\n", tmp1);
  1088. X    exit(-1);
  1089. X  }
  1090. X  i = 1;
  1091. X  printf("\n\n");
  1092. X  while (fgets(s, 250, fp) != NULL) {
  1093. X    if ((i >= von) && (i <= bis)) {
  1094. X        if (mode == 'l')
  1095. X            printf("L%04.4d %s", i, s);
  1096. X        else
  1097. X            printf("%s", s);
  1098. X    }
  1099. X    i++;
  1100. X  }
  1101. X  fclose(fp);
  1102. X}
  1103. X
  1104. X
  1105. X
  1106. Xloeschen()
  1107. X{
  1108. X  FILE *fp;
  1109. X  FILE *ff;
  1110. X  char t[STRING];
  1111. X  char s[255];
  1112. X  int i;
  1113. X
  1114. X  if ((von != 0) && (bis == 0)) bis = von;
  1115. X  if ((von == 0) && (bis == 0)) bis = 32000;
  1116. X
  1117. X  if (von > bis) {
  1118. X    /*
  1119. X    printf("\n\nLED: Fehler bei der Zeilenangabe.\n");
  1120. X    */    
  1121. X    printf("\n\nLED: %s\n", BLD01_MSG);
  1122. X    return;
  1123. X  }
  1124. X  ff = fopen(tmp2, "w");
  1125. X  if (ff == NULL) {
  1126. X    printf("\n%s\n", tmp2);
  1127. X    exit(-1);
  1128. X  }
  1129. X  fp = fopen(tmp1, "r");
  1130. X  if (fp == NULL) {
  1131. X    printf("\n%s\n", tmp1);
  1132. X    exit(-1);
  1133. X  }
  1134. X  i = 1;
  1135. X  printf("\n\n");
  1136. X  while (fgets(s, 250, fp) != 0) {
  1137. X    if ((i < von) || (i > bis)) {
  1138. X        fputs(s, ff);
  1139. X    }
  1140. X    i++;
  1141. X  }
  1142. X  fclose(fp);
  1143. X  fclose(ff);
  1144. X
  1145. X  unlink(tmp1);
  1146. X  rename(tmp2, tmp1);
  1147. X}
  1148. X
  1149. X
  1150. X
  1151. Xupload()
  1152. X{
  1153. X  FILE *fp;
  1154. X  char c;
  1155. X  char lf;
  1156. X
  1157. X  fp = fopen(tmp2, "w");
  1158. X  if (fp == NULL) {
  1159. X    printf("\n%s\n", tmp2);
  1160. X    exit(-1);
  1161. X  }
  1162. X  /*
  1163. X  printf("\n\nLED: Uebertragung beginnt. (Beenden mit CTRL-X !)\n\n");
  1164. X  */
  1165. X  printf("\n\nLED: %s\n\n", BLD02_MSG);
  1166. X
  1167. X  c = 0;
  1168. X  lf = CR;
  1169. X
  1170. X
  1171. X  while ((c != CTRL_X) && (c != CTRL_D)) {
  1172. X
  1173. X        c = getint();
  1174. X
  1175. X    if ((c == CR) && (lf == CR)) fputc(LF, fp);
  1176. X    if (c == CR) lf = CR;
  1177. X    if (c == LF) lf = LF;
  1178. X    if ((c != CTRL_X) && (c != CTRL_D) && (c != CR)) {
  1179. X        fputc(c, fp);
  1180. X    }
  1181. X  }
  1182. X  fclose(fp);
  1183. X}
  1184. X
  1185. X
  1186. X
  1187. Xkorrigieren()
  1188. X{
  1189. X  FILE *fp;
  1190. X  FILE *ff;
  1191. X  char s[255];
  1192. X  char t[255];
  1193. X  int i;
  1194. X
  1195. X  if (von == 0) {
  1196. X    /*
  1197. X    printf("\n\nLED: Fehler bei der Zeilenangabe.\n");
  1198. X    */    
  1199. X    printf("\n\nLED: %s\n", BLD01_MSG);
  1200. X    return;
  1201. X  }
  1202. X  fp = fopen(tmp1, "r");
  1203. X  if (fp == NULL) {
  1204. X    printf("\n%s\n", tmp1);
  1205. X    exit(-1);
  1206. X  }
  1207. X  ff = fopen(tmp2, "w");
  1208. X  if (ff == NULL) {
  1209. X    printf("\n%s\n", tmp1);
  1210. X    exit(-1);
  1211. X  }
  1212. X  i = 1;
  1213. X  while (fgets(s, 250, fp) != NULL) {
  1214. X    if (i == von) {
  1215. X        t[0] = '\0';
  1216. X        strcat(t, stripped(s));
  1217. X        s[0] = '\0';
  1218. X        if (length(t) < 74)
  1219. X            printf("\n\nK%04.4d ", i);
  1220. X        else
  1221. X            printf("\n\n");
  1222. X        strcat(s, getline(74, 1001, ' ', t));
  1223. X        strcat(s, "\n");
  1224. X        printf("\n");
  1225. X    }
  1226. X    fputs(s, ff);
  1227. X    i++;
  1228. X  }
  1229. X  fclose(ff);
  1230. X  fclose(fp);
  1231. X  unlink(tmp1);
  1232. X  rename(tmp2, tmp1);
  1233. X}
  1234. X
  1235. X
  1236. X
  1237. X
  1238. Xcrunch(s)
  1239. Xchar s[];
  1240. X{
  1241. X  char t[STRING];
  1242. X  int i = 0, a = 0;
  1243. X
  1244. X  von = 0;
  1245. X  bis = 0;
  1246. X
  1247. X  while (s[i] != '\0') {
  1248. X    if ((s[i] == ',') || (s[i] == '-')) a = i;
  1249. X    i++;
  1250. X  }
  1251. X  if (a == 0) a = i;
  1252. X  t[0] = '\0';
  1253. X  strcat(t, strcopy(s, 3, (a - 1)));
  1254. X  von = atoi(t);
  1255. X  t[0] = '\0';
  1256. X  strcat(t, strcopy(s, (a + 1), i));
  1257. X  bis = atoi(t);
  1258. X  if ((a != i) && (bis == 0)) bis = 32000;
  1259. X}
  1260. X
  1261. X
  1262. X
  1263. X
  1264. X
  1265. Xint befehl(s)
  1266. Xchar s[];
  1267. X{
  1268. X  char c = s[1];
  1269. X
  1270. X  if ((s[2] != ' ') && (s[2] != '\0') && (s[1] != '\0')) {
  1271. X    /*
  1272. X    printf("\n\nLED: Syntax-Fehler.\n");
  1273. X    */
  1274. X    printf("\n\nLED: %s\n", BLD03_MSG);
  1275. X    return 0;
  1276. X  }
  1277. X  crunch(s);
  1278. X
  1279. X  switch (c) {
  1280. X      case '\0':
  1281. X            return FINISH;
  1282. X            break;
  1283. X      case '?':
  1284. X            printf("\n\n%c", CR);
  1285. X            ansi("mr");
  1286. X            /*
  1287. X            printf(" %s  -  Befehlsuebersicht ", VERSION);
  1288. X            */
  1289. X            printf(" %s  -  %s ", VERSION, BLD04_MSG);
  1290. X            ansi("me");
  1291. X            printf("\n\n");
  1292. X            /*
  1293. X            printf(".l [ZEILE]|[VON,BIS]   lesen\n");
  1294. X            printf(".L [ZEILE]|[VON,BIS]   lesen (keine Zeilennummern)\n");
  1295. X            printf(".i AB                  einfuegen\n");
  1296. X            printf(".a                     anhaengen (beendet einfuegen)\n");
  1297. X            printf(".k ZEILE               korrigieren\n");
  1298. X            printf(".d [ZEILE]|[VON,BIS]   loeschen\n");
  1299. X            printf(".u                     uebertragen (ASCII-Upload)\n");
  1300. X            printf(".q                     abbrechen\n");
  1301. X            printf(".h                     ausfuehrliche Hilfe\n");
  1302. X            printf(".                      sichern & beenden\n\n");
  1303. X            printf("ZEILE, VON, BIS, AB sind gueltige Zeilennummern.\n");
  1304. X            printf("Angaben in [KLAMMERN] sind optional. Werden\n");
  1305. X            printf("keine Angaben gemacht gilt AB=1, VON=1, BIS=32000.\n");
  1306. X            */
  1307. X            printf("%s\n", BLD05_MSG);
  1308. X            printf("%s\n", BLD06_MSG);
  1309. X            printf("%s\n", BLD07_MSG);
  1310. X            printf("%s\n", BLD08_MSG);
  1311. X            printf("%s\n", BLD09_MSG);
  1312. X            printf("%s\n", BLD10_MSG);            
  1313. X            printf("%s\n", BLD11_MSG);
  1314. X            printf("%s\n", BLD12_MSG);
  1315. X            printf("%s\n", BLD13_MSG);
  1316. X            printf("%s\n", BLD14_MSG);
  1317. X            printf("\n");
  1318. X            printf("%s\n", BLD15_MSG);
  1319. X            printf("%s\n", BLD16_MSG);
  1320. X            printf("%s\n", BLD17_MSG);
  1321. X            break;
  1322. X      case 'h':            printf("\n\n%c", CR);
  1323. X            ansi("mr");
  1324. X            /*
  1325. X            printf(" %s  -  Hilfe ", VERSION);
  1326. X            */
  1327. X            printf(" %s  -  %s ", VERSION, BLD18_MSG);
  1328. X            ansi("me");
  1329. X            printf("\n\n");
  1330. X            system( HILFE );
  1331. X            break;
  1332. X      case 'a':    
  1333. X            return APPEND;    
  1334. X            break;
  1335. X      case 'i':
  1336. X            return INSERT;    
  1337. X            break;
  1338. X      case 'l':
  1339. X      case 'L':
  1340. X            zeigen(c);
  1341. X            return APPEND;
  1342. X            break;
  1343. X      case 'd':
  1344. X            loeschen();
  1345. X            return APPEND;
  1346. X            break;
  1347. X      case 'k':
  1348. X      case 'c':
  1349. X            korrigieren();
  1350. X            return APPEND;
  1351. X      case 'u':
  1352. X            upload();
  1353. X            return UPLOAD;
  1354. X      case 'q':
  1355. X            unlink(tmp1);
  1356. X            unlink(tmp2);
  1357. X            /*
  1358. X            printf("\n\nLED: Abgebrochen. Datei NICHT gesichert.\n\n");
  1359. X            */
  1360. X            printf("\n\nLED: %s\n\n", BLD19_MSG);
  1361. X            exit(0);
  1362. X            break;
  1363. X      default:        /*
  1364. X            printf("\n\nLED: Befehl unbekannt.\n");
  1365. X            */
  1366. X            printf("\n\nLED: %s\n", BLD20_MSG);
  1367. X}
  1368. X  return 0;
  1369. X}
  1370. X
  1371. X
  1372. X
  1373. X
  1374. X
  1375. Xint erfassen(line, mode)
  1376. Xint line, mode;
  1377. X{
  1378. X  FILE *fp;
  1379. X  char s[STRING];
  1380. X  char t[STRING];
  1381. X  char def[STRING];
  1382. X  int ok = 0;
  1383. X  int elin = line;
  1384. X  int startlin = line - 1;
  1385. X  int a, b;
  1386. X
  1387. X  melted = 1;            /* Sicher ist sicher ... */
  1388. X  THE_LINE = startlin;
  1389. X
  1390. X  fp = fopen(tmp2, "w");
  1391. X  if (fp == NULL) return -1;
  1392. X
  1393. X  def[0] = '\0';
  1394. X
  1395. X  do {
  1396. X    if (elin > max_line) max_line = elin;
  1397. X    printf("\n%c%04.4d ", imode, elin);
  1398. X    s[0] = '\0';
  1399. X    if (def[0] == '\0')
  1400. X        strcat(s, getline(73, 1, ' ', " "));
  1401. X    else
  1402. X        strcat(s, getline(73, 1001, ' ', def));
  1403. X
  1404. X    if (strcomp("<BREAK>", s) == 0) {
  1405. X        sprintf(s, ".?");
  1406. X    }
  1407. X    if (s[0] == '.') {
  1408. X        fclose(fp);
  1409. X        melted = melt(startlin);
  1410. X
  1411. X        ok = befehl(s);
  1412. X
  1413. X        if (ok == UPLOAD) {
  1414. X            melted = 1;
  1415. X            melted = melt(startlin);
  1416. X            ok = APPEND;
  1417. X        }
  1418. X        if (ok == INSERT) {
  1419. X            imode = 'I';
  1420. X            if (von < 1) von = 1;
  1421. X            if (von > max_line) {
  1422. X                ok = APPEND;
  1423. X            }
  1424. X             else {
  1425. X                startlin = von - 1;
  1426. X                THE_LINE = startlin;
  1427. X                elin = von;
  1428. X            }
  1429. X        }
  1430. X        if (ok == APPEND) {
  1431. X            imode = 'A';
  1432. X            unlink(tmp2);
  1433. X            rename(tmp1, tmp2);
  1434. X            startlin = getfile(tmp2);
  1435. X            if (startlin < 1) startlin = 0;
  1436. X            elin = startlin + 1;
  1437. X            THE_LINE = startlin;
  1438. X        }
  1439. X        fp = fopen(tmp2, "w");
  1440. X        if (fp == NULL) return -1;
  1441. X
  1442. X    } else {
  1443. X        def[0] = '\0';
  1444. X        a = length(s);
  1445. X        if (a == 73) {
  1446. X            while ((s[a] != ' ') && (a > 40)) a--;
  1447. X            if (s[a] == ' ') {
  1448. X                strcat(def, strcopy(s, (a + 1), 73));
  1449. X                s[a] = '\0';
  1450. X                for (b = a; b < 73; b++) printf("%c", BS);
  1451. X                for (b = a; b < 73; b++) printf(" ");
  1452. X            }
  1453. X        }
  1454. X        fprintf(fp, "%s\n", s);
  1455. X        elin++;
  1456. X        melted++;
  1457. X    }
  1458. X  } while (ok != FINISH);
  1459. X  return elin;
  1460. X}
  1461. X
  1462. X
  1463. X
  1464. Xsigcatch(sig)
  1465. Xint sig;
  1466. X{
  1467. X
  1468. X  switch (sig) {
  1469. X      case SIGINT:
  1470. X      case SIGQUIT:
  1471. X      case SIGHUP:
  1472. X      case SIGABRT:
  1473. X      case SIGTERM:
  1474. X    melted++;
  1475. X    melt(THE_LINE);
  1476. X    bledmove(tmp1, THE_FILE);
  1477. X    unlink(tmp1);
  1478. X    unlink(tmp2);
  1479. X    /*
  1480. X    printf("\n\nLED: Prozess terminiert. Datei gesichert.\n\n");
  1481. X    */
  1482. X    printf("\n\nLED: %s\n\n", BLD21_MSG);
  1483. X    exit(-1);
  1484. X    break;
  1485. X  }
  1486. X}
  1487. X
  1488. X
  1489. X
  1490. Xint getfile(path)
  1491. Xchar path[];
  1492. X{
  1493. X  FILE *fp;
  1494. X  FILE *ff;
  1495. X  int i = 0;
  1496. X  char s[STRING];
  1497. X
  1498. X  ff = fopen(tmp1, "w");
  1499. X  if (ff == NULL) {
  1500. X    printf("\n%s\n", tmp1);
  1501. X  }
  1502. X  fp = fopen(path, "r");
  1503. X  if (fp == NULL) {
  1504. X    fclose(ff);
  1505. X    return -1;
  1506. X  }
  1507. X  if (fgets(s, STRING, fp) != 0) i++;
  1508. X  if ((s[0] == 1) && (s[1] == 3)) {    /* MAGIC NUMBER */
  1509. X    return -2;
  1510. X  }
  1511. X  fputs(s, ff);
  1512. X
  1513. X  while (fgets(s, STRING, fp) != NULL) {
  1514. X    fputs(s, ff);
  1515. X    i++;
  1516. X  }
  1517. X  fclose(fp);
  1518. X  fclose(ff);
  1519. X
  1520. X  return i;
  1521. X}
  1522. X
  1523. X
  1524. X
  1525. Xmain(argc, argv)
  1526. Xint argc;
  1527. Xchar *argv[];
  1528. X{
  1529. X  char s[STRING];
  1530. X
  1531. X  int eof = 0;
  1532. X
  1533. X
  1534. X  if (argc < 2) {
  1535. X    /*
  1536. X    printf("\nLED: Keine Datei angegeben.\n\n");
  1537. X    */
  1538. X    printf("\nLED: %s\n\n", BLD22_MSG);
  1539. X    return;
  1540. X  }
  1541. X  /*
  1542. X  signal(SIGINT, sigcatch);
  1543. X  signal(SIGQUIT, sigcatch);
  1544. X  signal(SIGHUP, sigcatch);
  1545. X  signal(SIGABRT, sigcatch);
  1546. X  signal(SIGTERM, sigcatch);
  1547. X  */
  1548. X  signal(SIGINT,  SIG_IGN);
  1549. X  signal(SIGQUIT, SIG_IGN);
  1550. X  signal(SIGHUP,  SIG_IGN);
  1551. X  signal(SIGABRT, SIG_IGN);
  1552. X  signal(SIGTERM, SIG_IGN);
  1553. X
  1554. X#ifndef _SYS7
  1555. X
  1556. X  setbuf(stdout, NULL);
  1557. X
  1558. X#endif
  1559. X
  1560. X  ansi( "INIT" );
  1561. X
  1562. X  sprintf(s, " %s ", VERSION);
  1563. X  headline(s);
  1564. X  /*
  1565. X  printf("\nMomentchen ...");
  1566. X  */
  1567. X  printf("\n%s", BLD23_MSG);
  1568. X
  1569. X  sprintf(tmp1, "%s/bled1.%d", TMP, getpid());
  1570. X  sprintf(tmp2, "%s/bled2.%d", TMP, getpid());
  1571. X
  1572. X  sprintf(THE_FILE, "%s", argv[1]);
  1573. X  THE_LINE = 0;
  1574. X
  1575. X  eof = getfile(THE_FILE);
  1576. X  printf("%c", CR);
  1577. X  if (eof == -2) {
  1578. X    /*
  1579. X    printf("Datei \"%s\" enthaelt ein ausfuehrbares Programm.\n\n", THE_FILE);
  1580. X    */
  1581. X    printf("%s \"%s\" %s\n\n", BLD24_MSG, THE_FILE, BLD25_MSG);
  1582. X    return;
  1583. X  }
  1584. X  if (eof == -1)
  1585. X    /*
  1586. X    printf("Datei wird angelegt.");
  1587. X    */
  1588. X    printf("%s", BLD26_MSG);
  1589. X  else
  1590. X    /*
  1591. X    printf("Datei enthaelt %d Zeilen.", eof);
  1592. X    */
  1593. X    printf("%s %d %s", BLD27_MSG, eof, BLD28_MSG);
  1594. X  
  1595. X  /*
  1596. X  printf(" Befehlsuebersicht: \".?\"\n");
  1597. X  */
  1598. X  printf(" %s: \".?\"\n", BLD04_MSG);
  1599. X
  1600. X  if (eof < 1) eof = 0;
  1601. X  melted = 0;
  1602. X  max_line = eof;
  1603. X  eof++;
  1604. X
  1605. X  imode = 'A';
  1606. X
  1607. X  if (erfassen(eof, APPEND) < 1) {
  1608. X    /*
  1609. X    printf("\n\nLED: Probleme ...\n\n");
  1610. X    */
  1611. X    printf("\n\nLED: %s\n\n", BLD29_MSG);
  1612. X  }
  1613. X  bledmove(tmp1, THE_FILE);
  1614. X  unlink(tmp1);
  1615. X  unlink(tmp2);
  1616. X
  1617. X  /*
  1618. X  printf("\n\nUnd 'tschuess ...\n\n");
  1619. X  */
  1620. X  printf("\n\n%s\n\n", BLD30_MSG);
  1621. X}
  1622. END_OF_FILE
  1623.   if test 11258 -ne `wc -c <'src/bled.c'`; then
  1624.     echo shar: \"'src/bled.c'\" unpacked with wrong size!
  1625.   fi
  1626.   # end of 'src/bled.c'
  1627. fi
  1628. if test -f 'src/lesen2.c' -a "${1}" != "-c" ; then 
  1629.   echo shar: Will not clobber existing file \"'src/lesen2.c'\"
  1630. else
  1631.   echo shar: Extracting \"'src/lesen2.c'\" \(10222 characters\)
  1632.   sed "s/^X//" >'src/lesen2.c' <<'END_OF_FILE'
  1633. X/***************************************************************************/
  1634. X/*        PROGRAMM  ix/Mbox                           */
  1635. X/*             DATEI  lesen2.c                           */
  1636. X/*        FUNKTIONEN  anzeigen(), lesen2(), inhalt2(), loeschen2()       */
  1637. X/*             AUTOR  vs (Volker Schuermann/MINIX-Version)           */
  1638. X/*  LETZTE AENDERUNG  20.11.1991                       */
  1639. X/***************************************************************************/
  1640. X
  1641. X#include <stdio.h>
  1642. X
  1643. X#include "mbox.h"
  1644. X
  1645. X
  1646. Xextern char headinfo[STRING];
  1647. X
  1648. X/***************************************************************************/
  1649. X/*      FUNKTION  anzeigen()                           */
  1650. X/*  BESCHREIBUNG  Artikel selektieren und anzeigen.               */
  1651. X/*     PARAMETER  art  =  Artikel(-Nummer)                                 */
  1652. X/*          von  =  Artikel-Nummer (Minimum)                         */
  1653. X/*          bis  =  Artikel-Nummer (Maximum)                         */
  1654. X/*     RUECKGABE  siehe "show()"                       */
  1655. X/***************************************************************************/
  1656. X
  1657. Xint anzeigen(art, von, bis)
  1658. Xint art, von, bis;
  1659. X{
  1660. X  char entry[STRING];
  1661. X  char s[STRING];
  1662. X  int mr;
  1663. X  int ok;
  1664. X
  1665. X  if (strcomp(BRETT, "PM") != 0) {
  1666. X    sprintf(entry, "%s/%d", BRETT, art);
  1667. X  }
  1668. X  else {
  1669. X    sprintf(entry, "%s/usr/%d/%d", HOME, USER.id, art);
  1670. X  }
  1671. X
  1672. X  mr = 0;
  1673. X  if ((USER.more == 1) || (USER.more == 3)) mr = 2;
  1674. X
  1675. X  sprintf(s, "%d", art);
  1676. X
  1677. X  if (((art >= von) && (art <= bis)) ||
  1678. X      ((art >= bis) && (art <= von))) {
  1679. X
  1680. X    ok = pruefe(s);    
  1681. X
  1682. X    if(ok == 0){
  1683. X        if(USER.more != 0){
  1684. X            sprintf(headinfo, " %s %d (%s) ", LE201_MSG, art, NG);
  1685. X            headline( headinfo );
  1686. X        }
  1687. X        else{
  1688. X            ansi("md");
  1689. X            printf("%s %d\n", LE202_MSG, art);
  1690. X            ansi("me");
  1691. X        }
  1692. X        show( "?", 99, 99 );
  1693. X        ok = show(entry, 9999, mr);
  1694. X        if(ok != -1){
  1695. X            if(USER.more != 0) more();
  1696. X        }
  1697. X        else return ok;
  1698. X    }
  1699. X  }
  1700. X  return ok;
  1701. X}
  1702. X
  1703. X
  1704. X
  1705. X/***************************************************************************/
  1706. X/*      FUNKTION  lesen2()                            */
  1707. X/*  BESCHREIBUNG  Artikel selektieren (je nach Parameter) und anzeigen.    */
  1708. X/*     PARAMETER  arg  =  Selektions-Schluessel                            */
  1709. X/*          mode =  DUMMY (!)                                        */
  1710. X/*     RUECKGABE  keine                                                       */
  1711. X/***************************************************************************/
  1712. X
  1713. Xvoid lesen2(arg, mode)
  1714. Xchar arg[];
  1715. Xchar mode;
  1716. X{
  1717. X  FILE *fp;
  1718. X  char ex[255];
  1719. X  char s[STRING];
  1720. X  char entry[STRING];
  1721. X  int a = 56, b = 63;
  1722. X  int i, d, e;
  1723. X  int von, bis;
  1724. X  int ALLE;
  1725. X  int PM = 0;
  1726. X  int art[MAX_PER_NG];
  1727. X  int artp;
  1728. X  int k, l;
  1729. X  int LR = 0;
  1730. X
  1731. X
  1732. X  i = 0;
  1733. X  k = -1;
  1734. X  l = -1;
  1735. X  while (arg[i] != '\0') {
  1736. X    if (arg[i] == '-') k = i;
  1737. X    if (arg[i] == '*') l = i;
  1738. X    i++;
  1739. X  }
  1740. X
  1741. X  if ((arg[0] != '\0') && (k == -1) && (l == -1)) {
  1742. X    ansi("md");
  1743. X    printf(" %s\n", LE203_MSG);
  1744. X    ansi("me");
  1745. X    return;
  1746. X  }
  1747. X
  1748. X  von = 1;
  1749. X  bis = 32000;
  1750. X
  1751. X  if (l != -1) {
  1752. X    ALLE = 1;
  1753. X  }
  1754. X  if (k != -1) {
  1755. X    strcpy(s, (char *) strcopy(arg, 0, (k - 1)));
  1756. X    von = atoi(s);
  1757. X    strcpy(s, (char *) strcopy(arg, (k + 1), length(arg)));
  1758. X    bis = atoi(s);
  1759. X
  1760. X    if (von == 0) von = 1;
  1761. X    if (bis == 0) bis = 32000;
  1762. X    ALLE = 1;
  1763. X  }
  1764. X  if ((k == -1) && (l == -1)) {
  1765. X    ALLE = 0;
  1766. X  }
  1767. X  if ((von == 1) && (bis == 32000)) LR++;
  1768. X
  1769. X  if ((USER.leserichtung != 1) && (LR != 0)) {
  1770. X    i = von;
  1771. X    von = bis;
  1772. X    bis = i;
  1773. X  }
  1774. X  if (strcomp(BRETT, "PM") != 0) {
  1775. X    PM = 0;
  1776. X  }
  1777. X  else {
  1778. X    PM = 1;
  1779. X  }
  1780. X
  1781. X  d = a + 10;
  1782. X  e = a + 14;
  1783. X
  1784. X  maybe_locked(INHALT, "r");
  1785. X  fp = fopen(INHALT, "r");
  1786. X  if (fp == NULL) {
  1787. X    nerror("lesen2.c", 104, "lesen2", "Datei-Lesefehler", INHALT);
  1788. X  }
  1789. X  artp = -1;
  1790. X  while (fgets(ex, 250, fp) != NULL) {
  1791. X    if (ALLE == 1) {
  1792. X        artp++;
  1793. X        art[artp] = atoi(ex);
  1794. X    }
  1795. X    else {
  1796. X        strcpy(s, (char *) strcopy(ex, a, b));
  1797. X        if (LASTLOG < dateconv(s)) {
  1798. X            artp++;
  1799. X            art[artp] = atoi(ex);
  1800. X        }
  1801. X        if (LASTLOG == dateconv(s)) {
  1802. X            strcpy(s, (char *) strcopy(ex, d, e));
  1803. X            if (LASTTIME <= timeconv(s)) {
  1804. X                artp++;
  1805. X                art[artp] = atoi(ex);
  1806. X            }
  1807. X        }
  1808. X    }
  1809. X    if(artp >= MAX_PER_NG){
  1810. X        nerror("lesen2.c", 188, "lesen2", "Zuviele", "Artikel");
  1811. X    }
  1812. X  }
  1813. X  fclose(fp);
  1814. X
  1815. X
  1816. X
  1817. X  if (artp == -1) {
  1818. X    ansi("md");
  1819. X    printf(" %s", LE204_MSG);
  1820. X    ansi("me");
  1821. X    printf("\n");
  1822. X    return;
  1823. X  }
  1824. X  ansi("cl");
  1825. X
  1826. X  if (strcomp(BRETT, "PM") != 0) {
  1827. X    i = von;
  1828. X    von = bis;
  1829. X    bis = i;
  1830. X  }
  1831. X
  1832. X  show("?", 0, 99);
  1833. X
  1834. X  if (von > bis) {
  1835. X    for (i = artp; i >= 0; i--) {
  1836. X        if (anzeigen(art[i], von, bis) == -1) return;
  1837. X    }
  1838. X  }
  1839. X  else {
  1840. X    for (i = 0; i <= artp; i++) {
  1841. X        if (anzeigen(art[i], von, bis) == -1) return;
  1842. X    }
  1843. X  }
  1844. X
  1845. X  return;
  1846. X}
  1847. X
  1848. X
  1849. X
  1850. X
  1851. X/***************************************************************************/
  1852. X/*      FUNKTION  inhalt2()                            */
  1853. X/*  BESCHREIBUNG  Inhalt selektieren (je nach Parameter) und anzeigen.        */
  1854. X/*     PARAMETER  arg  =  Selektions-Schluessel                            */
  1855. X/*          mode =  DUMMY (!)                                        */
  1856. X/*     RUECKGABE  keine                                                       */
  1857. X/***************************************************************************/
  1858. X
  1859. Xvoid inhalt2(arg, mode)
  1860. Xchar arg[];
  1861. Xchar mode;
  1862. X{
  1863. X  FILE *fp;
  1864. X  FILE *ff;
  1865. X  char ex[255];
  1866. X  char s[STRING];
  1867. X  char tmp[STRING];
  1868. X  int a = 56, b = 63;
  1869. X  int e, d, i;
  1870. X  int von, bis;
  1871. X  int k, l;
  1872. X  int plus, minus;
  1873. X  int PM;
  1874. X  int ALLE;
  1875. X  int LR = 0;
  1876. X
  1877. X
  1878. X  i = 0;
  1879. X  k = -1;
  1880. X  l = -1;
  1881. X  while (arg[i] != '\0') {
  1882. X    if (arg[i] == '-') k = i;
  1883. X    if (arg[i] == '*') l = i;
  1884. X    i++;
  1885. X  }
  1886. X
  1887. X  von = 1;
  1888. X  bis = 32000;
  1889. X
  1890. X  if ((arg[0] != '\0') && (k == -1) && (l == -1)) {
  1891. X    strcpy(s, (char *) strcopy(arg, 0, length(arg)));
  1892. X    von = atoi(s);    
  1893. X    bis = von;
  1894. X    ALLE = 1;
  1895. X  }
  1896. X
  1897. X  if (l != -1) {
  1898. X    ALLE = 1;
  1899. X  }
  1900. X  if (k != -1) {
  1901. X    strcpy(s, (char *) strcopy(arg, 0, (k - 1)));
  1902. X    von = atoi(s);
  1903. X    strcpy(s, (char *) strcopy(arg, (k + 1), length(arg)));
  1904. X    bis = atoi(s);
  1905. X
  1906. X    if (von == 0) von = 1;
  1907. X    if (bis == 0) bis = 32000;
  1908. X    ALLE = 1;
  1909. X  }
  1910. X
  1911. X  fp = fopen(INHALT, "r");
  1912. X  if (fp == NULL) {
  1913. X    brett( "~" );
  1914. X    return;
  1915. X  }
  1916. X  sprintf(tmp, "%s/I.%d", TMP, getpid());
  1917. X  ff = fopen(tmp, "w");
  1918. X
  1919. X  sprintf(ex, " %s (%s) ", LE205_MSG, NG);
  1920. X  ex[80] = '\0';
  1921. X  headline(ex);
  1922. X
  1923. X  fgets(ex, 250, fp);    /* alte Ueberschrift ausblenden */
  1924. X  fgets(ex, 250, fp);   /* dito */
  1925. X
  1926. X  if(strcomp(PDNG, NG) == 0){
  1927. X    printf("%s\n", GBL08_MSG); 
  1928. X  }
  1929. X  else{
  1930. X    printf("%s\n", GBL05_MSG);
  1931. X  }
  1932. X  printf("===============================================================================\n", ff);
  1933. X  
  1934. X
  1935. X  PM = 1;
  1936. X  if (strcomp(BRETT, "PM") != 0) {
  1937. X    i = von;
  1938. X    von = bis;
  1939. X    bis = i;
  1940. X    PM = 0;
  1941. X  }
  1942. X  plus = 0;
  1943. X  minus = 0;
  1944. X
  1945. X  d = a + 10;
  1946. X  e = a + 14;
  1947. X
  1948. X  if (((von == 1) && (bis == 32000)) || ((von == 32000) && (bis == 1))) LR++;
  1949. X
  1950. X  if ((USER.leserichtung != 1) && (LR != 0)) {
  1951. X    i = von;
  1952. X    von = bis;
  1953. X    bis = i;
  1954. X  }
  1955. X  if (von > bis) {
  1956. X    while (fgets(ex, 250, fp) != NULL) {
  1957. X        i = atoi(ex);
  1958. X        if(i != 0) minus++;
  1959. X        if (ALLE == 1) {
  1960. X            if ((i >= bis) && (i <= von)) {
  1961. X                fputs(ex, ff);
  1962. X                plus++;
  1963. X            }
  1964. X    } else {
  1965. X            strcpy(s, (char *) strcopy(ex, a, b));
  1966. X            if (LASTLOG < dateconv(s)) {
  1967. X                fputs(ex, ff);
  1968. X                plus++;
  1969. X            }
  1970. X            if (LASTLOG == dateconv(s)) {
  1971. X                strcpy(s, (char *) strcopy(ex, d, e));
  1972. X                if (LASTTIME <= timeconv(s)) {
  1973. X                    fputs(ex, ff);
  1974. X                    plus++;
  1975. X                }
  1976. X            }
  1977. X        }
  1978. X    }
  1979. X    fclose(ff);
  1980. X
  1981. X    if (PM == 1)
  1982. X        sprintf(s, "sort -nr -o %s %s", tmp, tmp);
  1983. X    else
  1984. X        sprintf(s, "sort -n -o %s %s", tmp, tmp);
  1985. X    system(s);
  1986. X  }
  1987. X  else {
  1988. X    while (fgets(ex, 250, fp) != 0) {
  1989. X        i = atoi(ex);
  1990. X        if(i != 0) minus++;
  1991. X        if (ALLE == 1) {
  1992. X            if ((i >= von) && (i <= bis)) {
  1993. X                fputs(ex, ff);
  1994. X                plus++;
  1995. X            }
  1996. X        } 
  1997. X        else {
  1998. X            strcpy(s, (char *) strcopy(ex, a, b));
  1999. X            if (LASTLOG < dateconv(s)) {
  2000. X                fputs(ex, ff);
  2001. X                plus++;
  2002. X            }
  2003. X            if (LASTLOG == dateconv(s)) {
  2004. X                strcpy(s, (char *) strcopy(ex, d, e));
  2005. X                if (LASTTIME <= timeconv(s)) {
  2006. X                    fputs(ex, ff);
  2007. X                    plus++;
  2008. X                }
  2009. X            }
  2010. X        }
  2011. X    }
  2012. X    fclose(ff);
  2013. X  }
  2014. X  fclose(fp);
  2015. X
  2016. X  if (plus != 0) show(tmp, 9999, USER.more + 100);
  2017. X
  2018. X  unlink(tmp);
  2019. X
  2020. X  if (plus == 0) {
  2021. X    ansi("md");
  2022. X    printf("%s", LE206_MSG);
  2023. X    ansi("me");
  2024. X    if ((minus - plus) > 0)
  2025. X        printf("\n%s %d %s", LE207_MSG, minus, LE208_MSG);
  2026. X    else
  2027. X        printf("\n%s", LE209_MSG);
  2028. X  }
  2029. X  else if ((plus < 19) || (plus > 21)) {
  2030. X    if ((minus - plus) > 0)
  2031. X        printf("\n%s %d %s", LE210_MSG, (minus - plus), LE211_MSG);
  2032. X    else
  2033. X        printf("\n%s", LE212_MSG);
  2034. X  }
  2035. X  printf("\n");
  2036. X
  2037. X  return;
  2038. X}
  2039. X
  2040. X
  2041. X
  2042. X/***************************************************************************/
  2043. X/*      FUNKTION  loeschen2()                            */
  2044. X/*  BESCHREIBUNG  Persoenliche Post selektieren (je nach Parameter) und    */
  2045. X/*                loeschen.                           */
  2046. X/*     PARAMETER  arg  =  Selektions-Schluessel                            */
  2047. X/*          mode =  DUMMY (!)                                        */
  2048. X/*     RUECKGABE  keine                                                       */
  2049. X/***************************************************************************/
  2050. X
  2051. Xvoid loeschen2(arg, mode)
  2052. Xchar arg[];
  2053. Xchar mode;
  2054. X{
  2055. X  FILE *fp;
  2056. X  FILE *ff;
  2057. X  char ex[255];
  2058. X  char s[STRING];
  2059. X  char tmp[STRING];
  2060. X  int a, b, i;
  2061. X  int von, bis;
  2062. X  int k;
  2063. X  int plus;
  2064. X  int PM;
  2065. X
  2066. X
  2067. X  if(USER.level == GUEST_LEV){
  2068. X    return;
  2069. X  }
  2070. X
  2071. X  i = 0;
  2072. X  k = -1;
  2073. X  while (arg[i] != '\0') {
  2074. X    if (arg[i] == '-') k = i;
  2075. X    i++;
  2076. X  }
  2077. X
  2078. X  if ((arg[0] != '\0') && (k == -1)) {
  2079. X    ansi("md");
  2080. X    printf(" %s\n", LE213_MSG);
  2081. X    ansi("me");
  2082. X    return;
  2083. X  }
  2084. X  von = 1;
  2085. X  bis = 32000;
  2086. X
  2087. X  if (k != -1) {
  2088. X    strcpy(s, (char *) strcopy(arg, 0, (k - 1)));
  2089. X    von = atoi(s);
  2090. X    strcpy(s, (char *) strcopy(arg, (k + 1), length(arg)));
  2091. X    bis = atoi(s);
  2092. X
  2093. X    if (von == 0) von = 1;
  2094. X    if (bis == 0) bis = 32000;
  2095. X  }
  2096. X  if (strcomp(BRETT, "PM") != 0) {
  2097. X    a = 60;
  2098. X    b = 69;
  2099. X  } else {
  2100. X    a = 58;
  2101. X    b = 65;
  2102. X  }
  2103. X
  2104. X  maybe_locked(INHALT, "r");
  2105. X
  2106. X  sprintf(tmp, "%s/%d.l2", TMP, getpid());
  2107. X  sprintf(s, "cp %s %s > /dev/null", INHALT, tmp);
  2108. X  system(s);
  2109. X
  2110. X  fp = fopen(tmp, "r");
  2111. X  if (fp == NULL) {
  2112. X    nerror("lesen2.c", 217, "loeschen2", "Datei-Lesefehler", tmp);
  2113. X  }
  2114. X  fgets(ex, 250, fp);
  2115. X  fgets(ex, 250, fp);
  2116. X
  2117. X  PM = 1;
  2118. X  if (strcomp(BRETT, "PM") != 0) {
  2119. X    i = von;
  2120. X    von = bis;
  2121. X    bis = i;
  2122. X    PM = 0;
  2123. X  }
  2124. X  plus = 0;
  2125. X
  2126. X  if (von > bis) {
  2127. X    while (fgets(ex, 250, fp) != NULL) {
  2128. X        i = atoi(ex);
  2129. X        if ((i >= bis) && (i <= von)) {
  2130. X            sprintf(s, "%d", i);
  2131. X            loeschen(s);
  2132. X            plus++;
  2133. X        }
  2134. X    }
  2135. X  }
  2136. X  else {
  2137. X    while (fgets(ex, 250, fp) != NULL) {
  2138. X        i = atoi(ex);
  2139. X        if ((i >= von) && (i <= bis)) {
  2140. X            sprintf(s, "%d", i);
  2141. X            loeschen(s);
  2142. X            plus++;
  2143. X        }
  2144. X    }
  2145. X  }
  2146. X  fclose(fp);
  2147. X
  2148. X  if (plus == 0) {
  2149. X    ansi("md");
  2150. X    printf("%s\n", LE214_MSG);
  2151. X    ansi("me");
  2152. X    return;
  2153. X  }
  2154. X  unlink(tmp);
  2155. X
  2156. X  return;
  2157. X}
  2158. END_OF_FILE
  2159.   if test 10222 -ne `wc -c <'src/lesen2.c'`; then
  2160.     echo shar: \"'src/lesen2.c'\" unpacked with wrong size!
  2161.   fi
  2162.   # end of 'src/lesen2.c'
  2163. fi
  2164. echo shar: End of archive 7 \(of 10\).
  2165. cp /dev/null ark7isdone
  2166. MISSING=""
  2167. for I in 1 2 3 4 5 6 7 8 9 10 ; do
  2168.     if test ! -f ark${I}isdone ; then
  2169.     MISSING="${MISSING} ${I}"
  2170.     fi
  2171. done
  2172. if test "${MISSING}" = "" ; then
  2173.     echo You have unpacked all 10 archives.
  2174.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2175. else
  2176.     echo You still must unpack the following archives:
  2177.     echo "        " ${MISSING}
  2178. fi
  2179. exit 0
  2180. exit 0 # Just in case...
  2181.