home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / MISC / stf.lzh / stf.doc < prev    next >
Text File  |  1994-04-24  |  6KB  |  111 lines

  1.  
  2.                                 StFortune
  3.  
  4.                              by Scott McGee
  5.  
  6.  
  7. StFortune is a program to display random quotes from Paramount's Star Trek
  8. (the original series), Star Trek movies, Star Trek: The Next Generation, and
  9. Star Trek: Deep Space Nine.  It includes quotes from all four series (the
  10. Deep Space Nine quotes are in a separate file). StFortune is Copyright 1992
  11. by Scott McGee. It may be freely distributed as long as it remains unmodified
  12. and all copyright notices remain intact. Distribution for profit is NOT
  13. allowed without prior written consent from the author.
  14.  
  15. The program comes with two quote files. One, stquotes, contains over 2000
  16. quotes from Star Trek, the movies, and The Next Generation.  A second file,
  17. ds9quotes, contains quotes from Deep Space Nine. This division into two files
  18. is mainly for my own benefit in adding new quotes as new episodes are shown.
  19. You can easily modify the quote files to separate or combine eras as you wish.
  20.  
  21. The StFortune program (henceforth called stf) has several options available.
  22. The first one to note, is set at compile time. This is the default path that
  23. stf uses to locate the quote file, and the index file. This path is set using
  24. a '#define QUOTEFILE_DEFAULT "<path>"' and a '#define INDEXFILE_DEFAULT 
  25. "<path>"' statement in C. If you are compiling the program, it is suggested
  26. that you modify the <path> portion in the source code to suit your machine/
  27. system, before compiling. These two defaults can be overridden so don't worry
  28. if you can't do this.
  29.  
  30. stf has conditional code to allow it to compile easily on a wide variety of
  31. machines. On many systems, simply typing "cc stf.c" will compile the program
  32. correctly. (Unfortunately for many people, the IBM PC (and clones) are not
  33. among these - though a simple command line option will allow it to compile
  34. easily still.) The first part of the source code contains comments describing
  35. the various symbol definitions that will allow proper compilation on your
  36. machine. Setting these definitions will require some knowledge of your system's
  37. C compiler and it's standard string library. Be sure to look at all the code
  38. through to the first function.
  39.  
  40. In addition to the two compile time settings, there are other options available
  41. to stf. They include both environment variables, and command line options.
  42. The environment variables that stf uses (on systems that support this ability)
  43. are QUOTEFILE and INDEXFILE. These two, if set to a non null value, will 
  44. override the compiled in defaults. Overriding the environment variables, are
  45. the two command line options "-f=<file>" and "-I=<file>" respectively. (Note:
  46. the '=' is NOT optional and can NOT be replaced by a space or left out! The
  47. initial '-' character used to specify an option, may be replaced with an '/'
  48. character to suit those using MSDOS. <file> refers to the actual file that
  49. you are specifying)
  50.  
  51. Additional command line options include:
  52.      -i      : remake index file
  53.      -u      : don't use index file
  54.      -n      : print quote number before quote
  55.      -?      : print help message
  56. The -? (-h on systems where ? is a wild card character) option will print a
  57. help message describing the command line options, syntax and other information.
  58.  
  59. While this program was designed explicitly for Star Trek quotes, it can be
  60. easily adapted to display other types of quotes, or even other types of data .
  61. The important thing to remember is that the first line of the file will contain
  62. the number of quotes in the file, and that each line thereafter will start with
  63. a five digit number followed by a '%' character. The remainder of the line
  64. is the quote as it will appear on the screen. If you hand maintain the
  65. quote file, you can rely entirely on the number (which may be space padded
  66. or '0' padded - the supplied quote files are space padded) to delimit quotes.
  67. stf relies entirely on the line numbers to determine what to print out.
  68. If you wish to use the supplied renum utility, the format of the last line
  69. in each quote is limited to starting with four spaces and two dashes 
  70. ("    --") so that renum can determine the end of the quote to renumber it.
  71.  
  72. The renum utility supplied is useful for modifying quote file where 
  73. renumbering would be required. It completely ignores the numbers in the file
  74. and uses the pattern I have on the last line of each quote ("    --") to
  75. determine quote numbers, then rewrites the file with the new numbers. This
  76. way, if you insert a quote in the middle of the file, you just run renum
  77. (renum oldquotefile newquotefile) and it will write a new version of the
  78. file with the line numbers (and the number at the beginning of the file)
  79. corrected.
  80.  
  81. The DS9 quotes can easily be combined with the stquotes file using the
  82. following method:
  83.  
  84. 1. remove the first line from ds9quotes (the total number of quotes)
  85. 2. append the ds9 quotes to the end of the st quotes (in UNIX, type
  86.    "cat stquotes ds9quotes > newquotes")
  87. 3. run renum ("renum newquotes stquotes" - note: this will overwrite the
  88.    existing stquotes file)
  89. 4. remove any intermediate files ("rm ds9quotes newquotes")
  90.  
  91.  
  92. For more information, you may contact me by email at smcgee@microware.com
  93. or by mail at:
  94.         Scott McGee
  95.         1900 NW 114th st
  96.         Des Moines, IA  50325
  97.  
  98. (If you like the program, donation will be gladly accepted!)
  99.  
  100.  
  101. I would like to acknowledge the work of others who have at one time or
  102. another helped with the quote file. The quote file, stquotes, is comprised
  103. of quotes from several sources (myself included) and has been edited by me.
  104. If any copyright is implied by law for me, I hereby relinquish my rights ON
  105. THE QUOTE FILES ONLY and place them in the public domain. I retain all rights
  106. on the programs in this distribution. This work is for entertainment only
  107. and is distributed WITHOUT ANY WARRANTY; without even the implied warranty
  108. or MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  109.  
  110. Scott
  111.