This is a very eclectic collection of hacks, from various fields.
lst is a a program that calculates the current local sidereal time given the reading of the system clock and a longitude, following the algoritm of Jean Meeus in "Astronomical Algorithms".
The longitude is obtained from the command line, and must be in the form "xxd yym.ss", where xx is the degrees of longitude (negative for west), yy is the minutes, and .ss is the fraction of a minute. This entire value should be enclosed in quotes, although lst will handle things if it is not.
The longitude may also be specified by the environment variable SITE_LONG, in the same format.
charfilter and linefilter are skeleton programs that implement either a character-oriented or a line-oriented Unix filter. Each implements the logic to read all the files on the command line or to read from standard input. All output is written to standard output.
Additionally, logic is provided to process each file either character-by-character in the case of charfilter and line by line in the case of linefilter. Actual processing is, of course, left up to the programmer.
varargs
is a skeleton program that illustrates the use of variable-length
argument lists in C.
It is conditioned on the manifest constant
NEED_VARARGS, which, if defined, uses the older
varargs
interface, or if undefined, uses the new-style
stdarg
interface. Thus, by default the code will use
stdarg
.
The program includes a main()
whose purpose is merely
to illustrate how the example function is called. When executed,
the program prints a small message which was built by the function.
The two-way server is a program that can be useful for testing software that is supposed to make TCP connections and carry on some sort of dialog. It listens for connections to a port specified by the "-p" option, and then copies the input from that connection to standard output, and writes standard input out the connection.
Thus, when the program is run interactively, once a connection is accepted, anything the remote software writes to the connection will appear on your terminal screen. Anything you type will be sent to the remote software as input. The "-r" option is supported to place the terminal in raw mode so that the full character set can be transmitted to the remote program.