home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / compsrcs / misc / volume06 / tape < prev    next >
Encoding:
Internet Message Format  |  1991-08-27  |  35.4 KB

  1. From decwrl!purdue!mailrus!jarvis.csri.toronto.edu!utgpu!attcan!uunet!allbery Fri Mar 24 22:22:48 PST 1989
  2. Article 807 of comp.sources.misc:
  3. Path: decwrl!purdue!mailrus!jarvis.csri.toronto.edu!utgpu!attcan!uunet!allbery
  4. From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5. Newsgroups: comp.sources.misc
  6. Subject: v06i046: tape - an audio tape data base program
  7. Message-ID: <50339@uunet.UU.NET>
  8. Date: 4 Mar 89 21:27:20 GMT
  9. Sender: allbery@uunet.UU.NET
  10. Reply-To: bleckmd@jacobs.CS.ORST.EDU (david bleckmann)
  11. Lines: 1549
  12. Approved: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  13.  
  14. Posting-number: Volume 6, Issue 46
  15. Submitted-by: bleckmd@jacobs.CS.ORST.EDU (david bleckmann)
  16. Archive-name: tape
  17.  
  18. Hopefully I have followed all protocol, here is my submission:
  19. [That long a signature isn't quite correct protocol, but... ok.  ++bsa]
  20.  
  21.  <------- ____  
  22.   &&&    /    \  __ _____,
  23.     `-- |  o   \'  `  &&/   David Bleckmann
  24.        `|      | o  },-'    UUCP: {tektronix,hp-pcd}!orstcs
  25.          \____( )__/                           !jacobs.cs.orst.edu!bleckmd    
  26.          ,'    \'   \       Internet/CSNet: bleckmd@jacobs.cs.orst.edu
  27.  /~~~~~~|.      |   .}~~~\    or:bleckmd%jacobs.cs.orst.edu@orstcs.cs.orst.edu
  28.   ,-----( .     |   .}--.   
  29.         | .    /\___/          US Mail: 861 SW Adams #3
  30.          `----^,\ \                     Corvallis, OR 97333
  31.                 \_/   ACK!
  32.  
  33.  
  34.  
  35. -----------------------------------------------
  36.  
  37. Tape data base program.  See README.DOC for complete description.
  38. Basically used for cataloging and alphabetizing a large number
  39. of audio (or other) tapes.  Runs on UNIX systems (at least BSD)
  40. and hopefully MS DOS as well.
  41.  
  42. ---- Cut Here and unpack ----
  43. #!/bin/sh
  44. # shar:    Shell Archiver  (v1.22)
  45. #    Packed Sun Feb 12 15:08:40 PST 1989 by jacobs.CS.ORST.EDU!bleckmd
  46. #    from directory /mnt/dave/src/tape
  47. #
  48. #    Run the following text with /bin/sh to create:
  49. #      Makefile
  50. #      README.DOC
  51. #      alpha.c
  52. #      dave.t
  53. #      header.h
  54. #      io.c
  55. #      main.c
  56. #      tape.prj
  57. #
  58. if test -f Makefile; then echo "File Makefile exists"; else
  59. echo "x - extracting Makefile (Text)"
  60. sed 's/^X//' << 'SHAR_EOF' > Makefile &&
  61. XOBJ= main.o io.o alpha.o
  62. XSRC= header.h main.c io.c alpha.c
  63. X
  64. X#For system V get rid of -ltermcap
  65. XLIB= -lcurses -ltermcap
  66. X
  67. X#Output file
  68. XEXE= tape
  69. X
  70. Xall: $(OBJ)
  71. X    cc -o $(EXE) $(OBJ) $(LIB)
  72. X
  73. X$(OBJ):header.h
  74. X
  75. Xclean:
  76. X    rm -f $(OBJ) core make.out
  77. X
  78. Xkill:
  79. X    rm -f $(OBJ) core make.out $(EXE)
  80. X
  81. X#local dependancy, not very useful ;-)
  82. Xprint:
  83. X    lpr -Porstcs $(SRC)
  84. SHAR_EOF
  85. chmod 0640 Makefile || echo "restore of Makefile fails"
  86. set `wc -c Makefile`;Sum=$1
  87. if test "$Sum" != "347"
  88. then echo original size 347, current size $Sum;fi
  89. fi
  90. if test -f README.DOC; then echo "File README.DOC exists"; else
  91. echo "x - extracting README.DOC (Text)"
  92. sed 's/^X//' << 'SHAR_EOF' > README.DOC &&
  93. XTape organiser - By David Bleckmann
  94. X
  95. XUse to organize tapes in a manner so that a certain tape side
  96. Xcan be found quickly and easily.  
  97. X
  98. XA problem with a large tape collection is that it is often hard
  99. Xto order your tapes so that you can find a particular album by
  100. Xa particular artist.  One way to try to solve this problem is
  101. Xto alphabetize your tapes according to the artist on the first
  102. Xside.  However, if the artist on the second side is different
  103. Xyou are forced to remember which tape side goes with which.
  104. X
  105. XI currently have 130 double sided 90 min tapes.  What I have done
  106. Xis number them sequentially in approximately the order I record 
  107. Xthem.  Thus, when I record a new tape it receives the next highest
  108. Xnumber.  I find this very helpful in my searches to discover which
  109. Xtape I am missing, or even to realize I am missing a tape.  By
  110. Xkeeping a record of the tapes I can often remember where I last
  111. Xhad a particular tape or who I lent it to.
  112. X
  113. XIn order to find a particular album by artist I wrote this 
  114. Xprogram.  It keeps a record of tapes and can print out a list
  115. Xof sides organized by tape number or by Alphabetized artist
  116. Xname.  It will even alphabetize by last name of the artist,
  117. Xif used correctly (or to ignore a leading 'the').
  118. X
  119. XI wrote it on a PC and then transported it to UNIX.  To transfer
  120. Xfrom one system to another edit header.h.  There are some other
  121. Xoptions you can set in there.
  122. X
  123. X
  124. XFILES:
  125. X------------------------------------------------
  126. X
  127. XMakefile    | Unix makefile, doesn't work on PC
  128. X
  129. Xheader.h    | Header file
  130. Xmain.c        | Main programming functions
  131. Xalpha.c        | Functions to do with alphabetizing
  132. Xio.c        | Functions that have to do with i/o
  133. X
  134. XTAPE.EXE    | PC exe file; don't try to run elsewhere!
  135. Xtape.prj    | project file for TURBO C
  136. Xdave.t        | test tape file (actually my list of tapes :-)
  137. X
  138. XDescription of some of the commands:
  139. X-----------------------------------------------------------
  140. X
  141. XNote:    These command Names are the default ones.  They can be changed
  142. X    by editing header.h
  143. X
  144. X'r'    Read in data from a file.  Use with files created with this program.
  145. X    Can also be done from command line, eg:
  146. X    tape data.t
  147. X
  148. X'a'    Add tape.  Entering 0 for a tape number exits.  Hitting return for 
  149. X    tape number adds the number or the last tape in memory plus one.
  150. X    A title for a side is usually in the format:
  151. X
  152. X    Artist Name:Album Title
  153. X
  154. X    Where the ':' is the delimiter (can be changed in header.h).
  155. X    If the album has no title, or is not appropriate, delete from
  156. X    the colon on.
  157. X
  158. X's'    Save data base.  Files usually end in '.t'
  159. X
  160. X'w'    Write data base.  Save as above.
  161. X
  162. X'e'    Edit.  Self explanatory.  Allows changing of a particular tape side
  163. X    or number.
  164. X
  165. X'l'    List tapes.
  166. X
  167. X'L'    List tapes, but do not alpha decode (see 'Correct Alpha Mismatch')
  168. X
  169. X'p'    Print file.  Choice of two output formats (at current time)
  170. X
  171. X'D'    Delete tape.
  172. X
  173. X'C'    Clear all tapes.
  174. X
  175. X'o'    Order tapes in numerical order or alphabetized to side 1.
  176. X
  177. X'A'    Correct alpha mismatch.  In order that the tape side may 
  178. X    be alphabetized according to a part of the title other than
  179. X    the first word, this command will rearrange the title so
  180. X    that the program will do this.  For example a title such
  181. X    as:
  182. X
  183. X    John Smith:I Bite the Songs
  184. X
  185. X    Would be properly changed to:
  186. X
  187. X    Smith|John:I Bite the Songs
  188. X
  189. X    Thus the '|' symbol indicates that the artist name should be
  190. X    rearranged to form the actual name.  Whenever any title is printed
  191. X    (except with 'L' above) the program will 'alpha-decode' the title
  192. X    which basically places any text between the '|' and the first ':'
  193. X    (these can also be changed from default in header.h) at the front
  194. X    of the line, followed by a space, the text previous to the '|',
  195. X    and if the encoded title has a ':', everything following the ':'.
  196. X
  197. X    To encode, select the command 'A', specify how you wish to search
  198. X    for your tapes you wish to change.  Once selected program will
  199. X    enter the 'correct' mode.  Use the left arrow and right arrow in
  200. X    MSDOS, and 'h' and 'l' in UNIX to move cursor and position it 
  201. X    underneath the 'space' you wish to flip the artist name around.
  202. X    Hit space bar to insert '|' and flip name, return to make no
  203. X    change, and 'Q' to exit.
  204. X
  205. X    Example:
  206. X
  207. X    To alphabetize -
  208. X    The Music of Cosmos
  209. X
  210. X    to Cosmos move the cursor to the space between 'of' and 'Cosmos'
  211. X    and hit the space bar.
  212. X
  213. X    To produce:
  214. X    Cosmos|The Music of
  215. X
  216. X'Q'    Quit.
  217. X
  218. X-----------------------------------------------------------
  219. X
  220. XDisclaimer:  Use at your own risk.  Any problems you have with this
  221. X    program are yours, and are not my responsibility.  If you have 
  222. X    fixes or improvements send them to me at:
  223. X
  224. X    bleckmd@jacobs.cs.orst.edu
  225. SHAR_EOF
  226. chmod 0640 README.DOC || echo "restore of README.DOC fails"
  227. set `wc -c README.DOC`;Sum=$1
  228. if test "$Sum" != "4574"
  229. then echo original size 4574, current size $Sum;fi
  230. fi
  231. if test -f alpha.c; then echo "File alpha.c exists"; else
  232. echo "x - extracting alpha.c (Text)"
  233. sed 's/^X//' << 'SHAR_EOF' > alpha.c &&
  234. X#include "header.h"
  235. X
  236. Xint nindex(s, c)    /*returns the position of the char c in the string s*/
  237. Xchar *s, c;
  238. X{
  239. Xint n;
  240. X
  241. X    n=0;
  242. X
  243. X    while(*s!=c && *s!='\0')
  244. X    {
  245. X    n++;
  246. X    s++;
  247. X    }
  248. X
  249. X    if (*s=='\0')
  250. X    return(-1);    /* -1 if not found */
  251. X
  252. X    return(n);
  253. X}
  254. X
  255. Xint allblank(s)    /* returns TRUE if no chars in string s */
  256. Xchar *s;
  257. X{
  258. X    while (*s!='\0')
  259. X    if (!isspace(*s++))
  260. X        return FALSE;
  261. X
  262. X    return TRUE;
  263. X}
  264. X
  265. Xchar *decode(p2, p1)    /*undoes alpha coding*/
  266. Xchar *p2, *p1;
  267. X{
  268. Xint vb, colen;
  269. X
  270. X    if ((vb=nindex(p1, VERT_BAR))!=-1)
  271. X    {
  272. X    colen=nindex(p1+vb, COLEN);
  273. X    colen=(colen!=-1) ? colen+vb : strlen(p1);
  274. X    strncpy(p2, p1+vb+1, colen-vb-1);
  275. X    p2[colen-vb-1]=' ';
  276. X    p2[colen-vb]='\0';
  277. X    strncat(p2, p1, vb);
  278. X    strcat(p2, p1+colen);
  279. X    }
  280. X    else
  281. X    strcpy(p2, p1);
  282. X
  283. X    return(p2);
  284. X}
  285. X
  286. Xvoid alpha_out(fp, t, count)
  287. XFILE *fp;
  288. Xstruct tape *t[];
  289. Xint count;
  290. X{
  291. Xint t_mark[MAX_NUM_TAPES][2], least_num, least_side, a, b;
  292. Xstring tmp;
  293. X
  294. X/* we need to fprint to fp an alphabetized list of tiles, and */
  295. X/* of course we do this inefficiently ;-).  We keep track of  */
  296. X/* what titles we have printed out so far in t_mark[] and     */
  297. X/* then print out the least of the remaining tapes.           */
  298. X
  299. X    for(a=0; a<count; a++)
  300. X    t_mark[a][0]=t_mark[a][1]=0;
  301. X
  302. X    for(;;)
  303. X    {
  304. X    least_num=count;    /*indicates we don't have least yet*/
  305. X    least_side=1;
  306. X    for(a=0; a<count; a++)         /* a == tape number */
  307. X        for(b=1; b<=2; b++)        /* b == side        */
  308. X
  309. X             if(!t_mark[a][b-1] &&
  310. X            (least_num==count ||
  311. X                strcmp(Sx(t[a],b), Sx(t[least_num],least_side))<0))
  312. X        {
  313. X            least_num=a;
  314. X            least_side=b;
  315. X        }
  316. X
  317. X        if (least_num==count)    /* we must be done with the lot */
  318. X        break;        /* so exit the for(;;) */
  319. X
  320. X        if (!allblank(Sx(t[least_num], least_side)))
  321. X            fprintf(fp, "Tape %-4d Side %c: %s\n", t[least_num]->num,
  322. X            SIDECHAR(least_side),
  323. X                decode(tmp, Sx(t[least_num],least_side)));
  324. X
  325. X        t_mark[least_num][least_side-1]=1;    /* mark this one as printed */
  326. X    }
  327. X}
  328. X
  329. Xint mvcur(cur, new)    /*returns new cursor position*/
  330. Xint cur, new;
  331. X{
  332. Xint a;
  333. X
  334. X    if (new < cur)
  335. X    for(a=cur; a>new; a--)
  336. X        BACKSPACE();
  337. X
  338. X    if (new > cur)
  339. X    for(a=cur; a<new; a++)
  340. X        putchar(SPACE);
  341. X
  342. X    return new;
  343. X}
  344. X
  345. Xint correct(s)    /*returns 1 if changes made, 0 if not*/
  346. X        /*-1 if Quit is incountered*/
  347. Xchar *s;
  348. X{
  349. Xint curpos, colenpos, a, b;
  350. Xstring tmp;
  351. X
  352. X#ifdef MS_DOS
  353. X    printf("\nUse <- and -> , hit space to insert a '%c'\n", VERT_BAR);
  354. X    printf("Return for no change; Q to quit\n\n");
  355. X
  356. X    fflush(stdin);
  357. X    printf("%s\n",  s);
  358. X
  359. X    colenpos=(a=nindex(s, COLEN))==-1 ? strlen(s) : a ;
  360. X
  361. X    if ((curpos=nindex(s, SPACE))==-1 || colenpos<curpos)
  362. X    {
  363. X    printf("No spaces found - No changes made.\n");
  364. X    return 0;
  365. X    }
  366. X
  367. X    mvcur(0, curpos);
  368. X
  369. X    do {
  370. X    while(!kbhit())
  371. X        ;
  372. X
  373. X        if ((b=getch())=='\0')    /*a function key is hit*/
  374. X        b=getch()+128;
  375. X
  376. X    if (b=='Q')
  377. X        return(-1); 
  378. X
  379. X        if (b==205)    /* -> */
  380. X        {
  381. X        a=nindex(s+curpos+1, SPACE)+curpos+1;
  382. X        if (a!=-1 && a<colenpos)
  383. X        curpos=mvcur(curpos, a);
  384. X    }
  385. X
  386. X        if (b==203)    /* <- */
  387. X    {
  388. X        b=curpos;    /* last known space */
  389. X        a=0;
  390. X        while ((a=nindex(s+a+1, SPACE)+a+1)<curpos && a!=-1)
  391. X        b=a;
  392. X
  393. X            curpos=mvcur(curpos, b);  /**/
  394. X    }
  395. X
  396. X        if (b==SPACE)    /* Alpha encode word */
  397. X    {
  398. X        a=nindex(s+curpos, COLEN);
  399. X        strncpy(tmp, s+curpos+1,
  400. X             (a=(a!=-1)?a+curpos:strlen(s)) - curpos - 1);
  401. X        tmp[a-curpos-1]=VERT_BAR;
  402. X        tmp[a-curpos]='\0';
  403. X            strncat(tmp, s, curpos);
  404. X        strcat(tmp, s+a);
  405. X
  406. X        strcpy(s, tmp);
  407. X        printf("\n%s\n", s);
  408. X        return(1);
  409. X    }
  410. X
  411. X    } while (b!=CR);
  412. X
  413. X    return 0;    /* CR hit, no changes made */
  414. X#else
  415. X    printf("\nUse '%c' and '%c', hit space to insert a '%c'\n", 
  416. X        LEFTCHAR, RIGHTCHAR, VERT_BAR);
  417. X    printf("Return for no change; Q to quit\n\n");
  418. X
  419. X    noecho();
  420. X    cbreak();
  421. X
  422. X    fflush(stdin);
  423. X    printf("%s\n",  s);
  424. X
  425. X    colenpos=(a=nindex(s, COLEN))==-1 ? strlen(s) : a ;
  426. X
  427. X    if ((curpos=nindex(s, SPACE))==-1 || colenpos<curpos)
  428. X    {
  429. X    printf("No spaces found - No changes made.\n");
  430. X    echo();
  431. X    nocbreak();
  432. X    return 0;
  433. X    }
  434. X
  435. X    mvcur(0, curpos);
  436. X
  437. X    do {
  438. X    b=getchar();
  439. X
  440. X        if (b==RIGHTCHAR)    /* -> */
  441. X        {
  442. X        a=nindex(s+curpos+1, SPACE)+curpos+1;
  443. X        if (a!=-1 && a<colenpos)
  444. X        curpos=mvcur(curpos, a);
  445. X    }
  446. X
  447. X        if (b==LEFTCHAR)    /* <- */
  448. X    {
  449. X        b=curpos;    /* last known space */
  450. X        a=0;
  451. X        while ((a=nindex(s+a+1, SPACE)+a+1)<curpos && a!=-1)
  452. X        b=a;
  453. X
  454. X            curpos=mvcur(curpos, b);  /**/
  455. X    }
  456. X
  457. X    if (b=='Q')     /* Quit */
  458. X    {
  459. X        echo();
  460. X        nocbreak();
  461. X        return(-1);
  462. X    }
  463. X
  464. X        if (b==SPACE)    /* Alpha encode word */
  465. X    {
  466. X        a=nindex(s+curpos, COLEN);
  467. X        strncpy(tmp, s+curpos+1,
  468. X             (a=(a!=-1)?a+curpos:strlen(s)) - curpos - 1);
  469. X        tmp[a-curpos-1]=VERT_BAR;
  470. X        tmp[a-curpos]='\0';
  471. X            strncat(tmp, s, curpos);
  472. X        strcat(tmp, s+a);
  473. X
  474. X        strcpy(s, tmp);
  475. X        printf("\n%s\n", s);
  476. X
  477. X        echo();
  478. X        nocbreak();
  479. X        return(1);
  480. X    }
  481. X
  482. X    } while (b!=CR);
  483. X
  484. X    echo();
  485. X    nocbreak();
  486. X    return 0;    /* CR hit, no changes made */
  487. X#endif
  488. X}
  489. X
  490. SHAR_EOF
  491. chmod 0640 alpha.c || echo "restore of alpha.c fails"
  492. set `wc -c alpha.c`;Sum=$1
  493. if test "$Sum" != "5018"
  494. then echo original size 5018, current size $Sum;fi
  495. fi
  496. if test -f dave.t; then echo "File dave.t exists"; else
  497. echo "x - extracting dave.t (Text)"
  498. sed 's/^X//' << 'SHAR_EOF' > dave.t &&
  499. X1
  500. XJarre|Jean-Michel:Oxygene
  501. XJarre|Jean-Michel:Equinoxe
  502. X2
  503. XEurithmics:1984
  504. XJarre|Jean-Michel:Les Chants Magnetiques
  505. X3
  506. XMen Without Hats:Rhythem of Youth
  507. XTangerine Dream:Warsaw in the Sun
  508. X4
  509. XJHS Band
  510. XTangerine Dream:Wavelength
  511. X5
  512. XJarre|Jean-Michel:L'Essential Jean-Michel Jarre
  513. XTangerine Dream:Flashpoint
  514. X6
  515. XTangerine Dream:Firestarter
  516. XTangerine Dream:Exit
  517. X7
  518. XJarre|Jean-Michel:Zoolook
  519. XTangerine Dream:Cyclone
  520. X8
  521. XJethro Tull:Under Wraps
  522. XDalek, I Love You
  523. X9
  524. XNuman|Gary:Replicas
  525. XNuman|Gary:Pleasure Principle
  526. X10
  527. XDepeche Mode:Some Great Reward
  528. XDepeche Mode:Black Celebration
  529. X11
  530. XTalking Heads:Fear of Music
  531. XGarrison|Michael:Prisms
  532. X12
  533. XTears for Fears:Various Remix Tape #1
  534. X
  535. X13
  536. XGraduate:Acting My Age
  537. XMcKenzie|Bob and Doug
  538. X14
  539. XTangerine Dream:Stratosfear
  540. XGarrison|Michael:Point of Inpact
  541. X15
  542. XTangerine Dream:Poland
  543. X
  544. X16
  545. XTangerine Dream:Tangram
  546. XTangerine Dream:Quichette
  547. X17
  548. XJones|Howard:Human's Lib
  549. XDream Academy|The
  550. X18
  551. XFrankie Goes to Hollywood:Welcome to the Pleasure Dome
  552. X
  553. X19
  554. XJones|Howard:Dream Into Action
  555. XJones|Howard:The 12" Album
  556. X20
  557. XLive Aid
  558. XJohn Valby
  559. X21
  560. XBerlin:Love Life
  561. XBerlin:Pleasure Victim
  562. X22
  563. XDolby|Thomas:Rare Remixes
  564. XManheim Steamroller:Freshaire III
  565. X23
  566. XAnderson|Laurie:United States
  567. X
  568. X24
  569. XAnderson|Laurie:United States
  570. X
  571. X25
  572. XAnderson|Laurie:United States
  573. X
  574. X26
  575. XModern English:Ricochet Days
  576. XDead or Alive:Youthquake
  577. X27
  578. XJethro Tull:Thick as a Brick
  579. XDepeche Mode:People are People
  580. X28
  581. XTears for Fears:Songs From the Big Chair
  582. XTears for Fears:The Hurting
  583. X29
  584. XJethro Tull:Stormwatch
  585. XVangelis:China
  586. X30
  587. XTalking Heads:Little Creatures
  588. XVega|Suzanne
  589. X31
  590. XTalking Heads:Speaking in Tounges
  591. XTalking Heads:More Songs About Buildings and Food
  592. X32
  593. XDepeche Mode:Speak and Spell
  594. XDepeche Mode:A Broken Frame
  595. X33
  596. XDepeche Mode:Constuction Time Again
  597. X
  598. X34
  599. XJones|Howard:Remix Tape 1
  600. X
  601. X35
  602. XJones|Howard:San Deigo Interview
  603. XDolby|Thomas:The Flat Earth
  604. X36
  605. XJarre|Jean-Michel:Rendez-Vous
  606. XManheim Steamroller:Fresh Aire VI
  607. X37
  608. XU2:Unforgetable Fire
  609. XU2:War
  610. X38
  611. XAnderson|Laurie:Mister Heartbreak
  612. XAnderson|Laurie:Home of the Brave
  613. X39
  614. XSimple Minds:Life in a Day
  615. XEcho and the Bunnymen:Heaven up Here
  616. X40
  617. XJethro Tull:Aqualung
  618. XSpinal Tap|Soundtrack to This is
  619. X41
  620. XGarrison|Michael:Eclipse
  621. XTangerine Dream:White Eagle
  622. X42
  623. XReal Life:Flame
  624. XReal Life:Heartland
  625. X43
  626. XU2:Boy
  627. XBowie|David:Let's Dance
  628. X44
  629. XRepo Man|Soundtrack to
  630. XIdol|Billy:Whiplash Smile
  631. X45
  632. XAltered Images:Pinky Blue
  633. XCure|The:Concert-The Cure Live
  634. X46
  635. XTangerine Dream:70-80 (tape 1)
  636. X
  637. X47
  638. XTangerine Dream:70-80 (tape 2)
  639. X
  640. X48
  641. XKitaro:Silk Road I
  642. XKitaro:Silk Road II
  643. X49
  644. XKitaro:Full Moon Story
  645. XKitaro:Astral Voyage
  646. X50
  647. XKitaro:In Person
  648. XKitaro:Asia Tour Super Live
  649. X51
  650. XKitaro:Tunhuang
  651. XAshra:Blackouts
  652. X52
  653. XTangerine Dream:Le Parc
  654. XTangerine Dream:Heartbreakers
  655. X53
  656. XDire Straits:Brothers in Arms
  657. X
  658. X54
  659. XJarre|Jean-Michel:The Concerts in China
  660. X
  661. X55
  662. XNuman|Gary:The Fury
  663. XNuman|Gary:Strange Charm
  664. X56
  665. XSimon and Garfunkel:Greatest Hits
  666. XVarious CD Samples
  667. X57
  668. XABC:How to be a Zillionaire
  669. XSimple Minds: Once Upon a Time
  670. X58
  671. XRush:Power Windows
  672. XVan Halen
  673. X59
  674. XFlock of Seagulls
  675. XFlock of Seagulls:Listen
  676. X60
  677. XSmiths|The
  678. XSmiths|The:Meat is Murder
  679. X61
  680. XU2:Under a Blood Red Sky
  681. XU2:October
  682. X62
  683. XMozart:Symphony 41 & 40
  684. X
  685. X63
  686. XVollenwieder|Andreas:Behind the Gardens...
  687. XVollenwieder|Andreas:Cavern Magica
  688. X64
  689. XWinston|George:December
  690. XWindom Hill:Sampler '84
  691. X65
  692. XGreenpeace
  693. X
  694. X66
  695. XDire Straits:Alchemy - Live
  696. X
  697. X67
  698. XIdol|Billy
  699. XIdol|Billy:Rebel Yell
  700. X68
  701. XThompson Twins:Here's to Future Days
  702. XBowie|David:Tonight
  703. X69
  704. XTangerine Dream:Green Desert
  705. XTangerine Dream:Legend
  706. X70
  707. XEtosha:Private Music in the Land of Dry Water
  708. XCosmos|The Music of
  709. X71
  710. XDif Juz:Who Says So
  711. XLadyhawk
  712. X72
  713. XBush|Kate:Hounds of Love
  714. XBush|Kate:The Dreaming
  715. X73
  716. XArt of Noise|The:Into Battle with the Art of Noise
  717. XArt of Noise|The:Who's Afraid of the Art of Noise?
  718. X74
  719. XArt of Noise|The:Various Remixes
  720. XThis Mortal Coil:It'll End in Tears
  721. X75
  722. XTears for Fears:Memories
  723. XTears for Fears:Remixes Tape 2
  724. X76
  725. XDalis Car:The Waking Hour
  726. XKarn|Mick:Titles
  727. X77
  728. XNuman|Gary:Warriors
  729. XNuman|Gary:Beserker
  730. X78
  731. XJethro Tull:Songs from the Woods
  732. XJethro Tull:Minstrel in the Gallery
  733. X79
  734. XJethro Tull:M.U. The Best of Jethro Tull
  735. XJethro Tull:A
  736. X80
  737. XCocteau Twins:Head Over Heals
  738. XCocteau Twins:Treasure
  739. X81
  740. XNuman and the Tubeway Army|Gary:First Album
  741. XNuman|Gary:Telekon
  742. X82
  743. XNuman|Gary:I, Assassin
  744. XNuman|Gary:Dance
  745. X83
  746. XAha:Hunting High and Low
  747. XSigue Sigue Sputnik:Faunt It
  748. X84
  749. XGenesis:Invisible Touch
  750. XGabriael|Peter:So
  751. X85
  752. XStawberry Switchblade
  753. XStawberry Switchblade:(12")
  754. X86
  755. XCour Field|The
  756. XModern English:Ricochet Days
  757. X87
  758. XUnderground Mixes
  759. XToy Dolls:Dig That Grove Baby
  760. X88
  761. XCure|The:Standing on a Beach - The Singles
  762. X
  763. X89
  764. XSkinny Puppy:Bites
  765. XSkinny Puppy:Mind:The Perpetual Intercourse
  766. X90
  767. XBauhaus:1979-1983
  768. X
  769. X91
  770. XJones|Howard:One to One
  771. XBerlin:Count Three and Pray
  772. X92
  773. XManheim Streamroller:Fresh Aire I
  774. XVangelis:Albedo 0.39
  775. X93
  776. XFrankie Goes to Hollywood:Liverpool
  777. XPop|Iggy:Blah-Blah-Blah
  778. X94
  779. XWindom Hill|An Evening With
  780. X4AD Various
  781. X95
  782. XSmiths|The:The Queen is Dead
  783. X
  784. X96
  785. XDead Can Dance
  786. XDead Can Dance:Spleen and Ideal
  787. X97
  788. XTears for Fears:Penthouse/Omni Magazine Concert
  789. X
  790. X98
  791. XSiouxsie and the Banshies:Nocturne
  792. X
  793. X99
  794. XCindytalk:Camouflage Heart
  795. XXymox|Clan of:Medusa
  796. X100
  797. XThis Mortal Coil:Filigree and Shadow
  798. X
  799. X101
  800. XBolshoi|The:Friends
  801. XCure|The:The Head on the Door
  802. X102
  803. XDead Kennedys:Fresh Fruit for Rotten Vegetables
  804. XSuicidal Tendecies
  805. X103
  806. XSiouxsie and the Banshies:Through the Looking Glass
  807. XSiouxsie and the Banshies:Tinderbox
  808. X104
  809. XTrisomie 21:Chapter IV
  810. XSisters of Mercy:Floodland
  811. X105
  812. XNuman|Gary:White Noise
  813. X
  814. X106
  815. XAnderson|Laurie:Home of the Brave Interview
  816. X
  817. X107
  818. XWire:The Ideal Copy
  819. XLove and Rockets:Earth Sun Moon
  820. X108
  821. XLonely is an Eyesore
  822. XRobyn Hitchcock:Element of Light
  823. X109
  824. XNuman|Gary:Exhibition
  825. X
  826. X110
  827. XDif Juz:Extractions
  828. XKarn|Mick:Dreanms of Reason
  829. X111
  830. XBreathless:Three Times and Waving
  831. XBreathless:The Glass Bead Game
  832. X112
  833. XNuman|Gary:Exhibition
  834. X
  835. X113
  836. XNuman|Gary:Exhibition
  837. XNuman|Gary:Exhibition (et al)
  838. X114
  839. XNelson|Bill:The Love that Whirls
  840. XNelson|Bill:La Belle et la Bete
  841. X116
  842. XByrne|Brian Eno and David:My Life in the Bush with Ghosts
  843. XBudd|Harold:The Pavilion of Dreams
  844. X117
  845. XRoxy Music:Avalon
  846. X
  847. X118
  848. XM:Pop Muzic
  849. XNegativeland:Escape from Noise
  850. X119
  851. XTalking Heads:Remain in Light
  852. XGabrial|Peter:Security
  853. X120
  854. XCheese
  855. X
  856. X121
  857. XBush|Kate:Never for Ever
  858. X
  859. SHAR_EOF
  860. chmod 0640 dave.t || echo "restore of dave.t fails"
  861. set `wc -c dave.t`;Sum=$1
  862. if test "$Sum" != "6076"
  863. then echo original size 6076, current size $Sum;fi
  864. fi
  865. if test -f header.h; then echo "File header.h exists"; else
  866. echo "x - extracting header.h (Text)"
  867. sed 's/^X//' << 'SHAR_EOF' > header.h &&
  868. X/*header.h                */
  869. X/*include file for tape sorting program    */
  870. X/*by David Bleckmann            */
  871. X
  872. X/*#define MS_DOS    /*define if on compiling on turbo C*/
  873. X
  874. X#include <stdio.h>
  875. X#include <ctype.h>
  876. X
  877. X#ifdef MS_DOS
  878. X#include <string.h>
  879. X#include <conio.h>
  880. X#else
  881. X/*for system V you may need to change <strings.h> to <string.h>*/
  882. X#include <strings.h>
  883. X#include <curses.h>
  884. X#endif
  885. X
  886. X#define SIDEAB      /*define if sides to be accessed as A or B rather*/
  887. X            /*than side 1 or 2.            */
  888. X
  889. X/* The following are used as defines so that the user can set up */
  890. X/* the program as he/she would like, i.e. change the command key */
  891. X/* letters, etc.  It is permissible to make changes, but     */
  892. X/* certainly isn't necesarry.                      */
  893. X
  894. X
  895. X#define MAX_NUM_TAPES 300
  896. X#define STR_LEN 80
  897. X#define SCRHT 11    /* number of tapes that fits on one screen */
  898. X
  899. X#define VERT_BAR '|'
  900. X#define COLEN    ':'
  901. X#define SPACE    ' '
  902. X#ifndef MS_DOS
  903. X#define CR    '\12'
  904. X#else
  905. X#define CR    '\15'
  906. X#endif
  907. X
  908. X/* COMMAND DEFINES */
  909. X#define READCOM     'r'
  910. X#define ADDCOM          'a'
  911. X#define WR1COM      's'
  912. X#define WR2COM         'w'
  913. X#define EDITCOM        'e'
  914. X#define LISTCOM     'l'
  915. X#define LIST2COM    'L'
  916. X#define PRINTCOM    'p'
  917. X#define DELCOM        'D'
  918. X#define CLEARCOM    'C'
  919. X#define RECOVCOM    'R'
  920. X#define ORDCOM        'o'
  921. X#define ALPHACOM    'A'
  922. X#define QUITCOM        'Q'
  923. X
  924. X#ifndef MS_DOS
  925. X/*LEFTCHAR and RIGHTCHAR are used in the Unix version of ALPHACOM*/
  926. X#define LEFTCHAR 'h'
  927. X#define RIGHTCHAR 'l'
  928. X#endif
  929. X
  930. X/* All further lines should probably not be changed    */
  931. X/*--------------------------------------------------------------------*/
  932. X
  933. X#ifndef TRUE    /* sometimes not defined */
  934. X#define TRUE 1
  935. X#endif
  936. X#ifndef FALSE
  937. X#define FALSE 0
  938. X#endif
  939. X
  940. X
  941. X#ifdef SIDEAB
  942. X#define SIDECHAR(pdq) ((pdq)!=2?'A':'B')
  943. X#define SIDE1CHAR 'A'
  944. X#define SIDE2CHAR 'B'
  945. X#else
  946. X#define SIDECHAR(pdq) ((pdq)!=2?'1':'2')
  947. X#define SIDE1CHAR '1'
  948. X#define SIDE2CHAR '2'
  949. X#endif
  950. X
  951. X#ifdef MS_DOS
  952. X#define BACKSPACE() gotoxy(wherex()-1, wherey())
  953. X#else
  954. X#define BS    '\10'
  955. X#define BACKSPACE() putchar(BS)
  956. X
  957. X/* For some reason TC's strncmp is strnicmp, thus the following macro */
  958. X#define strnicmp(aaa, bbb, ccc) strncmp(aaa, bbb, ccc)
  959. X#endif
  960. X
  961. X/* Side X macro; refers to the side yyy in the  struct tape *xxx */
  962. X#define Sx(xxx, yyy) ((yyy)==2 ? (xxx)->s2 : (xxx)->s1)
  963. X
  964. Xtypedef char string[STR_LEN];
  965. X
  966. Xstruct tape {
  967. X    int num;
  968. X    string s1;
  969. X    string s2;
  970. X};
  971. X
  972. X
  973. SHAR_EOF
  974. chmod 0640 header.h || echo "restore of header.h fails"
  975. set `wc -c header.h`;Sum=$1
  976. if test "$Sum" != "2282"
  977. then echo original size 2282, current size $Sum;fi
  978. fi
  979. if test -f io.c; then echo "File io.c exists"; else
  980. echo "x - extracting io.c (Text)"
  981. sed 's/^X//' << 'SHAR_EOF' > io.c &&
  982. X#include "header.h"
  983. X
  984. Xchar *crstrip(s)    /*strips off a '\n' off the end of a string if */
  985. Xchar *s;           /*there is one.                       */
  986. X{
  987. Xint a;
  988. X
  989. X    if (s != NULL  &&  s[a=strlen(s)-1] == '\n')
  990. X    s[a]= '\0';
  991. X
  992. X    return s;
  993. X}
  994. X
  995. Xint get_tape(t, fname)    /*returns count or -1 if error*/
  996. Xstruct tape *t[];
  997. Xchar *fname;
  998. X{
  999. XFILE *fp;
  1000. Xint a, b;
  1001. Xstring tmp;
  1002. Xchar *malloc();
  1003. X
  1004. X    if ((fp=fopen(fname, "r"))==NULL)
  1005. X    {
  1006. X    fprintf(stderr, "can't open file\n");
  1007. X    return(-1);
  1008. X    }
  1009. X    for (a=0; t[a]!=NULL; a++)
  1010. X    {
  1011. X    if (fgets(tmp, 80, fp)==NULL)    /* NULL implies EOF */
  1012. X    {
  1013. X        fclose(fp);
  1014. X        return(a);
  1015. X    }
  1016. X
  1017. X        if((t[a]->num=atoi(tmp)) == 0)
  1018. X    {
  1019. X        fprintf(stderr, "\"%s\" not tape number\n", tmp);
  1020. X        fclose(fp);
  1021. X        return(-1);
  1022. X    }
  1023. X    crstrip(fgets(t[a]->s1, 80, fp));
  1024. X    crstrip(fgets(t[a]->s2, 80, fp));
  1025. X    }
  1026. X
  1027. X    for(; a<MAX_NUM_TAPES && fgets(tmp, 80, fp)!=NULL; a++)
  1028. X    {
  1029. X        if((b=atoi(tmp)) == 0)
  1030. X    {
  1031. X        t[a]=NULL;
  1032. X        fprintf(stderr, "\"%s\" not tape number\n", tmp);
  1033. X        fclose(fp);
  1034. X        return(-1);
  1035. X    }
  1036. X    t[a]=(struct tape *) malloc(sizeof(struct tape));
  1037. X    t[a]->num=b;
  1038. X    crstrip(fgets(t[a]->s1, 80, fp));
  1039. X    crstrip(fgets(t[a]->s2, 80, fp));
  1040. X    }
  1041. X/* found EOF */
  1042. X    fclose(fp);
  1043. X    return(a);
  1044. X}
  1045. X
  1046. X
  1047. Xint save_tape(t, fname, count)
  1048. Xstruct tape *t[];
  1049. Xchar *fname;
  1050. Xint count;
  1051. X{
  1052. XFILE *fp;
  1053. Xint a;
  1054. X
  1055. X    if ((fp=fopen(fname, "w"))==NULL)
  1056. X    {
  1057. X    fprintf(stderr, "can't open file\n");
  1058. X    return(-1);
  1059. X    }
  1060. X    for(a=0; a<count; a++)
  1061. X    fprintf(fp, "%d\n%s\n%s\n", t[a]->num, t[a]->s1, t[a]->s2);
  1062. X    fclose(fp);
  1063. X    return(a);
  1064. X}
  1065. SHAR_EOF
  1066. chmod 0640 io.c || echo "restore of io.c fails"
  1067. set `wc -c io.c`;Sum=$1
  1068. if test "$Sum" != "1518"
  1069. then echo original size 1518, current size $Sum;fi
  1070. fi
  1071. if test -f main.c; then echo "File main.c exists"; else
  1072. echo "x - extracting main.c (Text)"
  1073. sed 's/^X//' << 'SHAR_EOF' > main.c &&
  1074. X#include "header.h"
  1075. X
  1076. X#define DB(xxx) /* fprintf(stderr, "Debug #%d", (xxx)); fflush(stdout); fflush(stderr) /**/
  1077. X
  1078. Xvoid greeting()
  1079. X{
  1080. X#ifdef MS_DOS
  1081. X    clrscr();
  1082. X#else
  1083. X    system("clear");
  1084. X#endif
  1085. X    printf("\n");
  1086. X    printf("Tape organizer 0.0 ---   By David Bleckmann \n ");
  1087. X    printf("\n");
  1088. X    printf("Created 1988 \n");
  1089. X    printf("\n");
  1090. X    printf("\n");
  1091. X    printf("Use/modify however you wish, but please give me credit for\n");
  1092. X    printf("my work.\n");
  1093. X    /* and excuse me for my "ammature" programming skills :-) */
  1094. X    printf("\n");
  1095. X    printf("Send all criticizism/improvements to me at my UUCP/internet address:\n");
  1096. X    printf("\n");
  1097. X    printf("\tbleckmd@jacobs.cs.orst.edu\n");
  1098. X    printf("\t{tektronix, hp-pcd}!orstcs!jacobs.cs.orst.edu!bleckmd\n");
  1099. X    printf("\n");
  1100. X    printf("\n");
  1101. X    printf("Use 'H', 'h', or '?' for help menu\n\n");
  1102. X
  1103. X}
  1104. X
  1105. Xmain(argc, argv)
  1106. Xint argc;
  1107. Xchar *argv[];
  1108. X{
  1109. Xstruct tape *t[MAX_NUM_TAPES];
  1110. Xint a, b, c, count;
  1111. Xstring fname, tmp, tmp1, tmp2;
  1112. Xint save_tape(), get_tape(), correct();
  1113. Xvoid clr_to_null(), alpha_out();
  1114. Xchar *decode(), *malloc();
  1115. Xextern int allblank();
  1116. X
  1117. XFILE *fp;
  1118. X
  1119. X    count=0;
  1120. X
  1121. X
  1122. X#ifndef MS_DOS
  1123. X    initscr();
  1124. X#endif
  1125. X
  1126. X    for (a=0; a<MAX_NUM_TAPES; a++)
  1127. X    t[a]= NULL;            /*clear all tape elements to NULL*/
  1128. X
  1129. X
  1130. X    switch(argc)
  1131. X    {
  1132. X    case 1:
  1133. X        greeting();
  1134. X        break;
  1135. X
  1136. X    case 2:
  1137. X        if ((count=get_tape(t, argv[1])) == -1)  /* return -1 if error */
  1138. X        {
  1139. X        greeting();
  1140. X        fprintf(stderr, "file error\n%s not loaded.\n", argv[1]);
  1141. X        }
  1142. X        else
  1143. X        {
  1144. X        greeting();
  1145. X        printf("File %s Loaded\n", argv[1]);
  1146. X            }
  1147. X        break;
  1148. X
  1149. X    default:
  1150. X        fprintf(stderr,
  1151. X        "Usage: %s [tapefile]\n where tapefile was created using %s\n",
  1152. X        argv[0], argv[0]);
  1153. X
  1154. X#ifndef MS_DOS
  1155. X        nocbreak();
  1156. X        endwin();
  1157. X#endif
  1158. X        exit(1);
  1159. X    }
  1160. X
  1161. X    for(;;)
  1162. X    {
  1163. X    printf("\nCommand:");
  1164. X    gets(tmp);
  1165. X
  1166. X    switch (*tmp)  {
  1167. X
  1168. X    case '?':
  1169. X    case 'h':
  1170. X    case 'H':    /*help command! (yes we have one)*/
  1171. X        printf("command list:\n");
  1172. X        printf("\t%c: read in file\n", READCOM);
  1173. X        printf("\t%c,%c: write to file\n", WR1COM, WR2COM);
  1174. X        printf("\t%c: add tape data\n", ADDCOM);
  1175. X        printf("\t%c: edit tape\n", EDITCOM);
  1176. X            printf("\t%c: list tapes\n", LISTCOM);
  1177. X        printf("\t%c: print out tapes\n", PRINTCOM);
  1178. X        printf("\t%c: delete a tape\n", DELCOM);
  1179. X            printf("\t%c: clear all tapes (careful!)\n", CLEARCOM);
  1180. X        printf("\t%c: order tapes\n", ORDCOM);
  1181. X        printf("\t%c: correct alpha mismatch\n", ALPHACOM);
  1182. X        printf("\t%c: quit\n", QUITCOM);
  1183. X        break;
  1184. X
  1185. X    case READCOM:
  1186. X        printf("file to read from:");
  1187. X        gets(fname);
  1188. X        if ((a=get_tape(t, fname)) == -1)  /* returns -1 on error */
  1189. X        fprintf(stderr, "file error\n");
  1190. X        else {
  1191. X        count=a;
  1192. X        printf("file read in: %d entries\n\n", count);
  1193. X        /*gets(tmp, STR_LEN);*/
  1194. X        }
  1195. X        break;
  1196. X
  1197. X    case WR1COM:
  1198. X    case WR2COM:
  1199. X        printf("file to save to:");
  1200. X        gets(fname);
  1201. X        if (save_tape(t, fname, count)==-1)  /* return -1 on error */
  1202. X        printf("Error: file not saved\n");
  1203. X        break;
  1204. X
  1205. X    case ADDCOM:
  1206. X        printf("enter 0 to quit...\n\n");
  1207. X        for(;;)
  1208. X        {
  1209. X        if (count>=MAX_NUM_TAPES)
  1210. X        {
  1211. X            printf("Can't have more than %d tapes\n", MAX_NUM_TAPES-1);
  1212. X            break;
  1213. X        }
  1214. X        printf("tape number=");
  1215. X        gets(tmp);
  1216. X        if (tmp[0] == '\0' && count > 0)
  1217. X        {
  1218. X            a=t[count-1]->num+1;
  1219. X            printf("%d\n", a);
  1220. X        }
  1221. X        else if ((a=atoi(tmp))==0)
  1222. X            break;
  1223. X        t[count]=(struct tape *) malloc(sizeof(struct tape));
  1224. X        t[count]->num=a;
  1225. X        printf("side %c:", SIDE1CHAR);
  1226. X        gets(t[count]->s1);
  1227. X        printf("side %c:", SIDE2CHAR);
  1228. X        gets(t[count]->s2);
  1229. X        ++count;    /*update current number of tapes*/
  1230. X        putchar('\n');
  1231. X        }    /*end of 'a'*/
  1232. X        break;
  1233. X
  1234. X    case EDITCOM:
  1235. X        printf("Enter tape #:");
  1236. X        gets(tmp);
  1237. X        if ((a=atoi(tmp))>0)
  1238. X        {
  1239. X        for(b=0; b<count && t[b]->num!=a; b++)
  1240. X            ;
  1241. X        if (b==count)
  1242. X        {
  1243. X            printf("tape not found\n");
  1244. X            break;
  1245. X        }
  1246. X        printf("%d:\n%c: %s\n%c: %s\n\n", t[b]->num, SIDE1CHAR,
  1247. X            t[b]->s1, SIDE2CHAR, t[b]->s2);
  1248. X
  1249. X#ifndef SIDEAB
  1250. X        printf("Edit: (1) Side 1, (2) Side 2, or (3) number:");
  1251. X
  1252. X        switch (a=atoi(gets(tmp))) {
  1253. X
  1254. X        case 3:
  1255. X            printf("\nNew Num:");
  1256. X            if ((a=atoi(gets(tmp)))>0)
  1257. X            t[b]->num=a;
  1258. X
  1259. X            break;
  1260. X
  1261. X        case 2:
  1262. X        case 1:
  1263. X            printf("\nNew Title for side %d:\n", a);
  1264. X            gets(Sx(t[b], a));
  1265. X            break;
  1266. X        } /*end of switch*/
  1267. X            printf("%d:\n1: %s\n2: %s\n\n", t[b]->num,
  1268. X                decode(tmp1, t[b]->s1), decode(tmp2, t[b]->s2));
  1269. X#else
  1270. X        printf("Edit: (A) Side A, (B) Side B, or (N) number:");
  1271. X
  1272. X        switch (a= *gets(tmp)) {
  1273. X
  1274. X        case 'N':
  1275. X        case '3':
  1276. X        case 'n':
  1277. X            printf("\nNew Num:");
  1278. X            if ((a=atoi(gets(tmp)))>0)
  1279. X            t[b]->num=a;
  1280. X
  1281. X            break;
  1282. X
  1283. X        case 'a':
  1284. X        case 'A':
  1285. X        case 'b':
  1286. X        case 'B':
  1287. X            a=(a=='a' || a=='A') ? 1 : 2 ;
  1288. X            printf("\nNew Title for side %c:\n", SIDECHAR(a));
  1289. X            gets(Sx(t[b], a));
  1290. X            break;
  1291. X        } /*end of switch*/
  1292. X            printf("%d:\nA: %s\nB: %s\n\n", t[b]->num,
  1293. X                decode(tmp1, t[b]->s1), decode(tmp2, t[b]->s2));
  1294. X#endif
  1295. X
  1296. X        } /*end of if (a>0)*/
  1297. X        break;
  1298. X
  1299. X    case LIST2COM:
  1300. X        c=FALSE;
  1301. X        for(a=0; a<count; a+=SCRHT)
  1302. X        {
  1303. X          for(b=a; b<a+SCRHT && b<count; b++)
  1304. X        printf("%d\t%s\n\t%s\n", t[b]->num, t[b]->s1,
  1305. X                    t[b]->s2);
  1306. X              if (!c && b<count)
  1307. X          {
  1308. X#ifndef MS_DOS
  1309. X          cbreak();
  1310. X#endif
  1311. X          printf("More (Quit, Continuous)?");
  1312. X          *tmp=getchar();
  1313. X#ifndef MS_DOS
  1314. X          nocbreak();
  1315. X#endif
  1316. X          putchar('\n');
  1317. X          if (*tmp=='q' || *tmp=='Q')
  1318. X              break;
  1319. X          if (*tmp=='c' || *tmp=='C')
  1320. X              c=TRUE;
  1321. X              }
  1322. X        }
  1323. X            break;
  1324. X
  1325. X    case LISTCOM:
  1326. X        c=FALSE;
  1327. X        for(a=0; a<count; a+=SCRHT)
  1328. X        {
  1329. X          for(b=a; b<a+SCRHT && b<count; b++)
  1330. X        printf("%d\t%s\n\t%s\n", t[b]->num, decode(tmp1, t[b]->s1),
  1331. X                    decode(tmp2,t[b]->s2));
  1332. X              if (!c && b<count)
  1333. X          {
  1334. X#ifndef MS_DOS
  1335. X          cbreak();
  1336. X#endif
  1337. X          printf("More (Quit, Continuous)?");
  1338. X          *tmp=getch();
  1339. X#ifndef MS_DOS
  1340. X          nocbreak();
  1341. X#endif
  1342. X          putchar('\n');
  1343. X          if (*tmp=='q' || *tmp=='Q')
  1344. X              break;
  1345. X          if (*tmp=='c' || *tmp=='C')
  1346. X              c=TRUE;
  1347. X              }
  1348. X        }
  1349. X            break;
  1350. X
  1351. X        case PRINTCOM:
  1352. X#ifdef MS_DOS
  1353. X        printf("Enter output device:\n(i.e. enter LPT1 to go to printer)");
  1354. X#else
  1355. X        printf("Enter output file:\n");
  1356. X#endif
  1357. X        printf("\n>");
  1358. X        gets(tmp);
  1359. X        if ((fp=fopen(tmp, "w")) == NULL)
  1360. X        {
  1361. X        fprintf(stderr, "Cannot open file\n");
  1362. X        break;
  1363. X            }
  1364. X
  1365. X            printf("\nPrint Format:\n");
  1366. X        printf("\t1: Standard output (just like '%c')\n", LISTCOM);
  1367. X        printf("\t2: Alphabetized index (num;side:Artist)\n");
  1368. X        printf("Choice:");
  1369. X        gets(tmp);
  1370. X
  1371. X            switch (atoi(tmp)) {
  1372. X
  1373. X            case 1:
  1374. X            for(a=0; a<count; a++)
  1375. X#ifndef SIDEAB
  1376. X            fprintf(fp,
  1377. X              /*don't print side2 if there ain't any*/
  1378. X                allblank(t[a]->s2) ? "Tape %4d side 1:%s\n"
  1379. X                  : "Tape %4d side 1:%s\n          side 2:%s\n",
  1380. X                    t[a]->num,
  1381. X                    decode(tmp1, t[a]->s1),
  1382. X                        decode(tmp2,t[a]->s2));
  1383. X#else
  1384. X            fprintf(fp,
  1385. X              /*don't print side2 if there ain't any*/
  1386. X                allblank(t[a]->s2) ? "Tape %4d side A:%s\n"
  1387. X                  : "Tape %4d side A:%s\n          side B:%s\n",
  1388. X                    t[a]->num,
  1389. X                    decode(tmp1, t[a]->s1),
  1390. X                        decode(tmp2,t[a]->s2));
  1391. X#endif
  1392. X                break;
  1393. X
  1394. X            case 2:
  1395. X        alpha_out(fp, t, count);
  1396. X        break;
  1397. X
  1398. X        } /*end of switch*/
  1399. X
  1400. X            fclose(fp);
  1401. X            break;
  1402. X
  1403. X    case CLEARCOM:
  1404. X        printf("Are you Sure(y/n)?");
  1405. X        gets(tmp);
  1406. X        if (*tmp=='y' || *tmp=='Y')
  1407. X            count=0;
  1408. X        break;
  1409. X
  1410. X        case RECOVCOM:    /*undocumented way of un-'C'ing...just enter a count*/
  1411. X        printf("Debug option - set new count\nEnter new number of tapes:");
  1412. X        if ((a=atoi(gets(tmp))) != 0)
  1413. X                count=a;
  1414. X        break;
  1415. X
  1416. X        case DELCOM:    /* Delete a tape */
  1417. X        printf("Delete tape\nEnter tape #:");
  1418. X        gets(tmp);
  1419. X        if ((a=atoi(tmp))>0)
  1420. X        {
  1421. X        for(b=0; b<count && t[b]->num!=a; b++)
  1422. X            ;
  1423. X        if (b==count)
  1424. X        {
  1425. X            printf("tape not found\n");
  1426. X            break;
  1427. X        }
  1428. X        printf("Tape: %d\nSide %c: %s\nSide %c: %s\nDelete (y/n)?",
  1429. X            t[b]->num, SIDE1CHAR, t[b]->s1, SIDE2CHAR, t[b]->s2);
  1430. X        gets(tmp);
  1431. X        if (tmp[0]=='y' || tmp[0]=='Y')
  1432. X        {
  1433. X            for(a=b; a<count-1; a++)
  1434. X                        t[a]=t[a+1];
  1435. X            t[a]=NULL;
  1436. X            count--;
  1437. X            printf("Tape deleted.\n");
  1438. X        }
  1439. X        else
  1440. X            printf("Tape not deleted.\n");
  1441. X            }
  1442. X        break;
  1443. X
  1444. X        case ORDCOM:    /*order tapes*/
  1445. X        printf("\nOrder with respect to:\n");
  1446. X        printf("\t1. Number\n\t2. Alphabetized to side %c\nChoice:",
  1447. X           SIDE1CHAR);
  1448. X        gets(tmp);
  1449. X        if ((a=atoi(tmp))==1 || a==2)
  1450. X        {
  1451. X                a=(a==1);    /*a is true if to be sorted numerically*/
  1452. X        printf("Sorting....");
  1453. X        fflush(stdout);
  1454. X
  1455. X                do {
  1456. X            b=0;    /*time for an inefficient bubble sort :-)*/
  1457. X            for(c=0; c<count-1; c++)
  1458. X                if (a ? t[c]->num > t[c+1]->num
  1459. X                  : strcmp(t[c]->s1, t[c+1]->s1) > 0)
  1460. X                        {
  1461. X                struct tape *tmp;
  1462. X                tmp=t[c];
  1463. X                t[c]=t[c+1];
  1464. X                t[c+1]=tmp;
  1465. X                b=1;
  1466. X                }
  1467. X        } while (b);
  1468. X
  1469. X                printf("Done.\n");
  1470. X        }
  1471. X        break;
  1472. X
  1473. X        case ALPHACOM:
  1474. X        printf("correct Alpha mismatch\n");
  1475. X        printf("1. Search for \"The\"\n");
  1476. X        printf("2. Name Search.\n");
  1477. X        printf("3. Specific Tape and Side.\n\n");
  1478. X        printf("Enter choice:");
  1479. X        gets(tmp);
  1480. X
  1481. X        switch (a=atoi(tmp)) {
  1482. X          case 1:
  1483. X        strcpy(tmp, "The");
  1484. X          case 2:
  1485. X        if (a!=1)
  1486. X        {
  1487. X            printf("Enter name to search for:");
  1488. X            gets(tmp);
  1489. X        }
  1490. X        c=strlen(tmp);
  1491. X
  1492. X        for(a=0; a<count; a++)
  1493. X          for(b=1; b<=2; b++)
  1494. X            if (strnicmp(Sx(t[a], b), tmp, c) == 0)
  1495. X            if (correct(Sx(t[a], b)) == -1)
  1496. X                goto qhit;
  1497. X    qhit:
  1498. X                break;
  1499. X
  1500. X              case 3:
  1501. X            printf("Enter tape number:");
  1502. X            gets(tmp);
  1503. X                if ((a=atoi(tmp))<1)
  1504. X                break;
  1505. X
  1506. X                for(c=0; t[c]->num!=a && c<count; c++)
  1507. X            ;
  1508. X            if (c==count)
  1509. X            {
  1510. X            printf("Tape not found\n");
  1511. X            break;
  1512. X            }
  1513. X
  1514. X                printf("Enter side:");
  1515. X            gets(tmp);
  1516. X        if (islower(*tmp))
  1517. X            *tmp=toupper(*tmp);
  1518. X
  1519. X            if (*tmp!=SIDE1CHAR && *tmp!=SIDE2CHAR)
  1520. X            break;
  1521. X
  1522. X                correct(*tmp!=SIDE1CHAR ? t[c]->s2 : t[c]->s1);
  1523. X            break;
  1524. X            } /* end of switch(a=atoi(tmp)) */
  1525. X        break;
  1526. X
  1527. X    case QUITCOM:
  1528. X        printf("\nBye !\n");
  1529. X
  1530. X#ifndef MS_DOS
  1531. X            nocbreak();
  1532. X        endwin();
  1533. X#endif
  1534. X        exit(0);
  1535. X
  1536. X    default:
  1537. X        fprintf(stderr, "error???\nUse 'H' for help\n");
  1538. X
  1539. X    }    /*end of command switch*/
  1540. X    }    /*end of for(;;)*/
  1541. X
  1542. X}    /*end of main()*/
  1543. X
  1544. SHAR_EOF
  1545. chmod 0640 main.c || echo "restore of main.c fails"
  1546. set `wc -c main.c`;Sum=$1
  1547. if test "$Sum" != "10479"
  1548. then echo original size 10479, current size $Sum;fi
  1549. fi
  1550. if test -f tape.prj; then echo "File tape.prj exists"; else
  1551. echo "x - extracting tape.prj (Text)"
  1552. sed 's/^X//' << 'SHAR_EOF' > tape.prj &&
  1553. Xmain (header.h)
  1554. Xio (header.h)
  1555. Xalpha (header.h)
  1556. SHAR_EOF
  1557. chmod 0640 tape.prj || echo "restore of tape.prj fails"
  1558. set `wc -c tape.prj`;Sum=$1
  1559. if test "$Sum" != "47"
  1560. then echo original size 47, current size $Sum;fi
  1561. fi
  1562. exit 0
  1563.  
  1564.  
  1565.