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 >
Wrap
Text File
|
1994-04-24
|
6KB
|
111 lines
StFortune
by Scott McGee
StFortune is a program to display random quotes from Paramount's Star Trek
(the original series), Star Trek movies, Star Trek: The Next Generation, and
Star Trek: Deep Space Nine. It includes quotes from all four series (the
Deep Space Nine quotes are in a separate file). StFortune is Copyright 1992
by Scott McGee. It may be freely distributed as long as it remains unmodified
and all copyright notices remain intact. Distribution for profit is NOT
allowed without prior written consent from the author.
The program comes with two quote files. One, stquotes, contains over 2000
quotes from Star Trek, the movies, and The Next Generation. A second file,
ds9quotes, contains quotes from Deep Space Nine. This division into two files
is mainly for my own benefit in adding new quotes as new episodes are shown.
You can easily modify the quote files to separate or combine eras as you wish.
The StFortune program (henceforth called stf) has several options available.
The first one to note, is set at compile time. This is the default path that
stf uses to locate the quote file, and the index file. This path is set using
a '#define QUOTEFILE_DEFAULT "<path>"' and a '#define INDEXFILE_DEFAULT
"<path>"' statement in C. If you are compiling the program, it is suggested
that you modify the <path> portion in the source code to suit your machine/
system, before compiling. These two defaults can be overridden so don't worry
if you can't do this.
stf has conditional code to allow it to compile easily on a wide variety of
machines. On many systems, simply typing "cc stf.c" will compile the program
correctly. (Unfortunately for many people, the IBM PC (and clones) are not
among these - though a simple command line option will allow it to compile
easily still.) The first part of the source code contains comments describing
the various symbol definitions that will allow proper compilation on your
machine. Setting these definitions will require some knowledge of your system's
C compiler and it's standard string library. Be sure to look at all the code
through to the first function.
In addition to the two compile time settings, there are other options available
to stf. They include both environment variables, and command line options.
The environment variables that stf uses (on systems that support this ability)
are QUOTEFILE and INDEXFILE. These two, if set to a non null value, will
override the compiled in defaults. Overriding the environment variables, are
the two command line options "-f=<file>" and "-I=<file>" respectively. (Note:
the '=' is NOT optional and can NOT be replaced by a space or left out! The
initial '-' character used to specify an option, may be replaced with an '/'
character to suit those using MSDOS. <file> refers to the actual file that
you are specifying)
Additional command line options include:
-i : remake index file
-u : don't use index file
-n : print quote number before quote
-? : print help message
The -? (-h on systems where ? is a wild card character) option will print a
help message describing the command line options, syntax and other information.
While this program was designed explicitly for Star Trek quotes, it can be
easily adapted to display other types of quotes, or even other types of data .
The important thing to remember is that the first line of the file will contain
the number of quotes in the file, and that each line thereafter will start with
a five digit number followed by a '%' character. The remainder of the line
is the quote as it will appear on the screen. If you hand maintain the
quote file, you can rely entirely on the number (which may be space padded
or '0' padded - the supplied quote files are space padded) to delimit quotes.
stf relies entirely on the line numbers to determine what to print out.
If you wish to use the supplied renum utility, the format of the last line
in each quote is limited to starting with four spaces and two dashes
(" --") so that renum can determine the end of the quote to renumber it.
The renum utility supplied is useful for modifying quote file where
renumbering would be required. It completely ignores the numbers in the file
and uses the pattern I have on the last line of each quote (" --") to
determine quote numbers, then rewrites the file with the new numbers. This
way, if you insert a quote in the middle of the file, you just run renum
(renum oldquotefile newquotefile) and it will write a new version of the
file with the line numbers (and the number at the beginning of the file)
corrected.
The DS9 quotes can easily be combined with the stquotes file using the
following method:
1. remove the first line from ds9quotes (the total number of quotes)
2. append the ds9 quotes to the end of the st quotes (in UNIX, type
"cat stquotes ds9quotes > newquotes")
3. run renum ("renum newquotes stquotes" - note: this will overwrite the
existing stquotes file)
4. remove any intermediate files ("rm ds9quotes newquotes")
For more information, you may contact me by email at smcgee@microware.com
or by mail at:
Scott McGee
1900 NW 114th st
Des Moines, IA 50325
(If you like the program, donation will be gladly accepted!)
I would like to acknowledge the work of others who have at one time or
another helped with the quote file. The quote file, stquotes, is comprised
of quotes from several sources (myself included) and has been edited by me.
If any copyright is implied by law for me, I hereby relinquish my rights ON
THE QUOTE FILES ONLY and place them in the public domain. I retain all rights
on the programs in this distribution. This work is for entertainment only
and is distributed WITHOUT ANY WARRANTY; without even the implied warranty
or MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Scott