Readable copy of JC's CGI directory
This is a copy of the CGI directory for
JC's tune finder's CGI directory.
This means that you can download the files here.
If you want to run them, try the
live CGI directory.
Note that some of the programs here have multiple names.
This is sometimes used for working on a test version without disturbing the
main public version of the program. You should use the first name.
Some of the interesting things here:
-
TuneFind
FindTune
findtune
-
is the CGI program behind the
ABC Tune Finder.
If called with no args, it produces the same form as that page.
-
TuneAdd
AddTune
-
is the CGI program behind the
ABCcontrib page,
which lets users add tunes to this collection.
-
TuneForm
-
is the CGI program that is run for some conversions, which produces a form
with lots of formatting options for the music. You fill in the form, and
it then invokes TuneGet to do the conversion.
-
TuneGet
GetTune
gettune
tune
-
is the CGI program that does conversions of ABC to other formats.
It does this by calling yet other subprocesses, of course, each
doing one kind of conversion.
-
TuneList
FileList
-
produces an "ABC" list of the files in a directory.
Files are searched for tunes, and the tunes listed, with links to conversions routines.
-
abcCode.pm
-
routines to calculate Gore/Breathnach codes from ABC notation.
-
cfg/
-
information about ABC web servers, mostly used by webcat.
-
cfghost.pm
-
reads the cfg/ file for a host and loads the data into global variables.
-
codedist.c
-
calculates the "distance" between two Gore/Breathnach codes.
-
doc/
-
contains assorted documents, mostly HTML.
-
formats.pm
-
contains routines for summarizing the available output formats for our conversions.
-
trillian-cgilocal.pm
minya-cgilocal.pm
kendy-cgilocal.pm
-
initialization for hosts where this code is installed.
This is mostly global variables saying where things may be found.
The first part of the name is the local hostname.
Most of the CGI scripts here use require to load the version of this file for the host.
-
outtune.pm
-
is a set of routines for writing ABC tunes to a file.
-
ps2gif
-
converts PS (Postscript) files to GIF format.
-
ps2pdf
-
converts PS (Postscript) files to PDF format.
-
ps2png
-
converts PS (Postscript) files to PNG format.
-
sendsubs.pm
-
contains routines for writing things to a log file and/or a web client.
Much of the reason for this module is for debugging, but it also helps
to standardize a few common kinds of output.
-
taintsubs.pm
-
contains routines for validating strings and processing them so they pass
the perl "taint" restrictions.
-
webcat
-
This is a separate program because of an intractable problem:
TCP connections to web servers sometimes block permanently in the connect() call.
This happens on several OSs, and there seems to be no solution.
So ABCbot calls webcat as a subprocess.
If webcat doesn't respond or exit within the timeout period, we kill it and go on.
It's a bit of a waste of cpu time, but it solves the problem.
-
webpage.pm
-
miscellaneous routines that assist in building web pages.
The most important is webpage(), which copies a file to the web client,
doing some text substitution along the way.
This includes <#EXPR#>, which is replaced with eval(EXPR).
This gives us a simple way of including system-dependent content
in a "static" portion of a web page.