2005-08-20  John Kodis  <john@kodis.org>

	* fcc.h (struct): Killed an invalid "extern int app_alloc,
	*app2fac;" declaration.

2005-03-15  John Kodis  <john@kodis.org>

	* fcc-search.c (sinfo_fill_am): Don't malloc memory here.  That
	gets done in sinfo_split_fill().
	(sinfo_fill_fm): Same as above.
	(sinfo_fill_tv): Same as above.
	(sort_and_show_sinfo): Remove a check for a NULL pointer that
	can't happen any longer.

2004-11-11  John Kodis  <john@kodis.org>

	* details.c (on_clist_button_release_event): Insure that we have a
	row before acting on it.

2004-07-24  John Kodis  <kodis@comcast.net>

	* Makefile.am (AM_CPPFLAGS): As automake says, "CPPFLAGS' is a
	user variable, you should not override it; use `AM_CPPFLAGS'
	instead."  And that's just what I did.

2003-04-19  John Kodis  <kodis@comcast.net>

	* fcc-ingest.c (ant_new): Initialize ant->pattern->rms to 1.  It's
	bogus, but still better than setting it to zero.

2003-04-17  John Kodis  <kodis@comcast.net>

	* station-info-cli.c (emit_details_tsv): Emit radiation pattern,
	min, max, rms, etc.

	* fcc-search.c (ant_fill_am_pattern): Set pattern.min.
	(sinfo_get_fm_tv_ant): Minor code rearrangement.

	* fcc-ingest.c (ant_pattern_fill_from_fields): Set pattern.min.

	* fcc.h (struct): Add pattern.min and pattern.rms fields.

2003-04-14  John Kodis  <kodis@comcast.net>

	* station-info-cli.c (emit_details_tsv): Emit radiation pattern
	information.

	* fcc-search.c (ant_fill_am_pattern): Move am_pattern() routine
	from details.c to here.
	(sinfo_get_ant): Compute and fill in AM antenna pattern
	information.

2003-04-13  John Kodis  <kodis@comcast.net>

	* Makefile.am (STATION_INFO): Modify to allow everything except
	the GUI to be built using a --without-gnome configure option.

2003-01-20  John Kodis  <kodis@comcast.net>

	* station-info-cli.c (emit_details_tsv): Also emit search lat and
	lon values.

	* geoloc.h (struct): Add norm element to hold normalized location
	string.  Mark key, first, last as private.

2002-12-26  John Kodis  <kodis@comcast.net>

	* station-info-cli.c (dump_sinfo): Write out the am-, fm-, and
	tv-specific bits of information.

2002-12-25  John Kodis  <kodis@comcast.net>

	* station-info-db-fetch.sh (CDBS_FILES): Add --force flags to some
	mv and gzip commands.

2002-12-17  John Kodis  <kodis@comcast.net>

	* fcc-search.c (fm_fill): Replace fm_fill_from_fields() with
	sinfo_fm_fill_from_fields().  Similarly for am_ and tv_ variants.
	(sinfo_fill_eng): Move some code from sinfo_fill() to here.
	(sinfo_fill): Handle am and tv similarly to fm.
	(sinfo_split_fill): Replace the am_fill(), fm_fill(), and
	tv_fill() routines with this generic routine.

	* fcc-ingest.c (sinfo_fm_fill_from_fields): Combine
	fm_fill_from_fields() and fm_ancillary_ingest() into
	sinfo_fm_fill_from_fields().  Similarly for am_ and tv_ variants.
	Simplify generic_ingest() as a result.

2002-12-16  John Kodis  <kodis@comcast.net>

	* utils.c (process_option): Add a -u, --details flag.

	* fcc-search.c (check_offset): Check for blatantly bogus file
	offsets, and fail with an error message if found.

2002-12-15  John Kodis  <kodis@comcast.net>

	* fcc-ingest.c (callsign_to_new): New routine pulled from the
	generic_ingest() routine.
	(service_to_anc): Ditto.

	* fcc-search.c (sinfo_fill): New routine to fill a sinfo struct
	from band and file offsets.

	* station-info-cli.c (dump_sinfo): Add code to dump detailed
	station information.

2002-12-14  John Kodis  <kodis@comcast.net>

	* utils.c (process_option): Require at least one argument to the
	--band and --option switches, and eliminate superfluous newlines
	from some error messages.

2002-12-13  John Kodis  <kodis@comcast.net>

	* station-info-cli.c (sinfos_display_tsv): Generate tab-seperated
	value output rather than html.

2002-12-09  John Kodis  <kodis@comcast.net>

	* utils.c (process_option): Remove newline from the end of all
	debug() calls.  The debug() routine adds this.

	* guess-where.c (guess_from_dot_emacs_file): Avoid segfaulting if
	$HOME is undefined, as is common when a web server executes a
	cgi-bin script.

	* utils.c (process_option): Add an --html command line flag to
	trigger html output.

	* station-info-cli.c (sinfos_display_html): Add an ability to
	generate an html table as output.

2002-12-01  John Kodis  <kodis@comcast.net>

	* station-info-db-fetch.sh (CDBS_HOME): Add a missing but vital
	semicolon to the cdbs_fetch() function.  Accommodate new filenames
	and locations on the FCC's web site.

	* utils.c (search_set_location): Reverse sense of
	geoloc_from_str() return code; don't mess with search->{lat,lon}
	unless a valid location is found.

2002-11-12  John Kodis  <kodis@comcast.net>

	* geoloc.c (place_fn): Add code to search for the most populous
	occurance of a city when no state is given.

2002-11-03  John Kodis  <kodis@comcast.net>

	* geoloc.c (vsearch): Use a custom variable record length binary
	search routine instead of kludging the standard bsearch routine
	into service.

2002-10-28  John Kodis  <kodis@comcast.net>

	* geoloc.c (place_fn): Add code to get a lat/lon for any of the
	cities listed in the US Census Bureau 2000 Gazetteer of place
	names.  Also, convert zipcode and callsign lookups to use
	colon-seperated data files rather than the fixed record length
	format used previously.

2002-10-15  John Kodis  <kodis@comcast.net>

	* utils.c (put_args): Helper function for warn(), debug(), and
	fatal().  Accepts a format string and a va_list.

2002-10-14  John Kodis  <kodis@comcast.net>

	* utils.c (debug): New function to centralize control of debugging
	messages.  Also add -v, --verbose switches.

	* fcc-search.c (map_file): Issue a warning rather than a fatal
	error if a file is missing or unreadable.  Push error handling up
	a level.
	(have_data): Eliminate this obsolete routine.

2002-10-13  John Kodis  <kodis@comcast.net>

	* fcc-search.c (sort_and_show_sinfo): Move comparison functions
	out of this function for the sake of compatibility.

2002-10-12  John Kodis  <kodis@comcast.net>

	* main.c (progress): #ifdef out all the splash-screen related
	stuff.

2002-10-11  John Kodis  <kodis@comcast.net>

	* fcc-search.c (have_data): Test for presence of sinfo data.

	* main.c (popt_options): Change "no-splash" option to
	"show-splash", and reverse corresponding tests.  Also eliminate
	the "ignore-index" option; an index is now always required.

2002-09-27  John Kodis  <kodis@comcast.net>

	* fcc-search.c (sort_and_show_sinfo): Add a total stations found
	parameter, distinct from the total stations kept parameter.

	* fcc-ingest.c (fcc_init): Eliminate sinfo_init_sort(), moving
	what was left of this code into the main fcc_init() routine.

	* fcc.h (struct): Remove the sort comparison functions from the
	search struct; fix up as required.

	* fcc-ingest.c (generic_ingest): Categorize low-power FM stations
	as regular stations, rather than as ancillary stations.

	* details.c (show_details_window): Fix lat/lon conversion.

2002-09-26  John Kodis  <kodis@comcast.net>

	* Makefile.am (station_info_SOURCES): Renamed things: fcc-bin.c to
	fcc-search.c; fcc-lib.c to fcc-ingest.c; fcc-lib.h to fcc.h;
	delete fcc-bin.h, zip-munge.c.  Renamed str-to-geoloc.{c,h} to
	geoloc.{c,h}.  Renamed gen-fcc-bin.c to station-info-gen-index.c,
	gen-callsigns-loc.c to station-info-call-loc.c.

	* fcc-lib.c (generic_ingest): Remove all trace of the Sid struct
	and all of the routines that manipulate them.  Good riddance.

2002-09-25  John Kodis  <kodis@comcast.net>

	* station-info-db-fetch.sh (CDBS_FILES): Unzip all data files.

	* str-to-geoloc.c (callsign_fn): Match callsigns ending in -FM,
	-LP, -TV, and the like.

	* fcc-lib.c (fcc_init): Initialize ingore_index and
	interesting_antennas both to false.

	* details.c (am_pattern): Get info from sinfo and ant structs
	rather than sid struct.

	* fcc-bin.c (sinfo_get_am_ant): New routine to extract antenna and
	tower information for AM stations.

	* gen-fcc-bin.c (munge_tower): New routine to generate tower index.

	* main.c (popt_options): Change station-info to use index files by
	default; add --ignore-index (-I) option for older, slower behavior.

2002-09-22  John Kodis  <kodis@comcast.net>

	* fcc-bin.c (sinfo_get_ant_rot): New routine comparable to
	sin_get_ant_rot().

	* gen-fcc-bin.c (munge_pat): Put the antenna make and pattern
	offsets in a struct rather than manipulating individual values.

	* fcc-lib.c (ant_free): New routine.
	(ant_make_fill_from_fields): Broken out from ingest_ant_make().
	(ant_pattern_fill_from_fields): Broken out from
	ingest_ant_pattern().

	* fcc-bin.c (sinfo_get_ant): New routine to get antenna
	information from the antenna make and pattern offsets.

2002-09-21  John Kodis  <kodis@comcast.net>

	* gen-fcc-bin.c (munge_pat): Write antenna make and pattern
	offsets to an ant_make_pat.sip file.

	* fcc-lib.c (ingest_ant_pattern): Collect antenna make and pattern
	offsets.

	* fcc-bin.c (sinfo_get_ant_id): New routine of obvious purpose.

	* callbacks.c (sids_display): Hey, waddaya know, sid-count isn't
	used anywhere, so don't set it (but do set sinfo-array).

	* details.c (show_details_window): Convert details window
	routines to operate from information in a Sinfo struct.

2002-09-20  John Kodis  <kodis@comcast.net>

	* callbacks.c (sinfos_display_clist): Search and display GUI data
	using the sinfo data structures.
	(on_clist_click_column): Fix column-sorting to operate on
	sinfo-based data.

2002-09-17  John Kodis  <kodis@comcast.net>

	* station-info-db-fetch.sh: Move data fetching and munging code
	out of the top-level Makefile and into the station-info-db-fetch
	shell script prototype.

	* gen-fcc-bin.c: Add band identification to output.

2002-08-17  John Kodis  <kodis@comcast.net>

	* fcc-lib.h (struct): Move sort_compare function pointers out of
	utils.c and into the Search struct.  Adjust code to accomodate.

	* station-info-cli.c (main): Add code to use the faster
	sinfo-based search routines instead of the slower sid-based ones. 

	* fcc-lib.c (sid_init_sort): Moved here from main.c.

	* callbacks.c: Shuffled sids, n_sids, and the two routines that
	reference these file-scope static variables to the end of the
	source file.

	* Makefile.am (gen_fcc_bin_SOURCES): Renamed from the slightly
	less descriptive 'station-info-munge' target.

	* fcc-bin.h: Typedefs and prototypes for the routines in
	fcc-bin.c.

	* fcc-bin.c: New file created from the remnants of the
	station-info-munge.c source file.  This file contains most of the
	code for generating and loading the *.si binary Sloc data files.

	* gen-fcc-bin.c: New file created from the remnants of the
	station-info-munge.c source file.  This program generates the *.si
	containing binary Sloc data.

2002-08-16  John Kodis  <kodis@comcast.net>

	* station-info-cli.c (main): Use the common sort_and_show_sid()
	routine from fcc-lib.

	* fcc-lib.c (sort_and_show_sid): Moved here from callbacks.c.
	(sid_compare_freq): Moved this and the _dist() and _power()
	comparison routines out of main.c back to here.

2002-08-15  John Kodis  <kodis@comcast.net>

	* main.c (main): Initialize search.keep_func with
	sid_compare_dist().

	* utils.c (sort_add_keys): Add code to accept a prefix of '~' to
	indicate the the sort order should be toggled.

	* main.c (sid_compare_freq): Moved this and the _dist() and
	_power() comparison routines out of callbacks.c to here.

	* callbacks.c (on_clist_click_column): Strip out all the remnants
	of the old sorting code.  Converted column sorting to use the new
	routines.

2002-08-14  John Kodis  <kodis@comcast.net>

	* utils.c (sort_add_keys): Moved this and some related stuff from
	-munge.c.
	(process_option): Renamed --show to --options, added --sort.

2002-08-13  John Kodis  <kodis@comcast.net>

	* fcc-lib.h (struct): Move the sort_func and sort_order arrays
	to here from -munge.c.

	* station-info-munge.c (sort_and_show_sinfo): Tidy up the sinfo
	sorting routines.

2002-08-12  John Kodis  <kodis@comcast.net>

	* station-info-munge.c (munge_eng): Issue a fatal error if a
	negative offset is encountered when trying to munge any of the
	data files.

2002-08-11  John Kodis  <kodis@comcast.net>

	* station-info-munge.c (search_filter_and_display): Steal all the
	sort and display code from callbacks.c, and adapt it to operate on
	sinfos rather than sids.  Add a khz field to sinfo.

	* fcc-lib.c (fac_fill_from_fields): Break out this logic, and
	share it between here and station-info-munge.c.  Similarly for
	{am,fm,tv}_fill_from_fields().
	(fac_fill_from_fields): Only fill from field information.
	(tv_channel_to_mhz): Expose, and share with -munge.
	(tv_channel_to_khz): Rename from mhz to khz.

	* station-info-munge.c (sinfo_fill_am): Add support for AM station
	information.
	(sinfo_is_near): Remember to divide sloc->corf by ten to scale it
	to a double.
	(sinfo_get_erp): Minor clean up.

2002-08-06  John Kodis  <kodis@comcast.com>

	* station-info-munge.c (sinfo_fill_tv): Add support for TV station
	information, patterned after the FM routines.

2002-08-05  John Kodis  <kodis@comcast.net>

	* station-info-munge.c (sinfo_fill_fm): Add support for filling in
	information from the FM engineering data file, patterned after the
	facility routines.

	* fcc-lib.h (struct Fm): Replace erp with vert_erp and horiz_erp.
	* fcc-lib.c (fm_ancillary_ingest): Fix erp ingest.
	* utils.c (sid_get_power): Fix FM erp calculation.

2002-08-05  John Kodis  <kodis@comcast.net>

	* station-info-munge.c (map_file): Tidy up the file open and mmap
	code a bit.

	* fcc-lib.c (generic_ingest): Save offset into engineering data
	file in eng_off.

2002-08-04  John Kodis  <kodis@comcast.net>

	* station-info-munge.c (munge_fm_eng): Fix value of sloc->old.
	(main): Add display of sloc->old, fac->service.  Add option
	processing from station-info-cli, trigger munging when keep==666.
	(munge_application): Remove this.  It seems unlikely to be needed.

2002-08-03  John Kodis  <kodis@comcast.net>

	* station-info-cli.c (long_options): Moved to utils, to share with
	station-info-munge.

	* utils.c (search_dump): Send diagnostic messages to stderr.

	* fcc-lib.c (fcc_init): Initialize search->keep.

	* station-info-munge.c (main): Got search of FM stations
	marginally functional.  Added guess-where support to match results
	of station-info and station-info-cli.

	* station-info-cli.c (main): Add an extra digit of precision to
	distance; use search_dump() to print location.

	* fcc-lib.c (ingest_fac): Keep track of the file offset for each
	facility record, for future munging.

	* utils.c (search_dump): Moved to utils.[ch] from callbacks.c,
	added call to station-info-cli and station-info-munge.

2002-07-28  John Kodis  <kodis@comcast.net>

	* station-info-cli.c (main): Honor the --keep option setting.

2002-07-27  John Kodis  <kodis@comcast.net>

	* gen-callsigns-loc.c (callsign_locations): New program used to
	generate the lat/lon data file for all station callsigns.

	* str-to-geoloc.c (geoloc_from_str): Use mmapped text files
	located in $PKGDATADIR for zip code and station locations.

	* Makefile.am (CPPFLAGS): Keep all shareable data files under
	$PKGDATADIR (by default, /usr/local/share/station-info/).

2002-07-22  John Kodis  <kodis@comcast.net>

	* str-to-geoloc.c (geo_get_callsign): Add support for station
	callsigns as location specifiers.  Also objectify the code.

2002-07-21  John Kodis  <kodis@comcast.net>

	* fcc-lib.c (callsign_normalize): Normalize callsigns by
	eliminating leading blanks, and replacing embedded blanks with
	hyphens.

	* station-info-munge.c (callsign_locations): Generates a list of
	all unique callsigns with their lat/lon information.

	* utils.c (process_option): Add an --antennas option to restrict
	searches to stations with interesting antenna patterns.  Also got
	rid of pi and friends, in favor of the M_PI series of constants.

2002-07-20  John Kodis  <kodis@comcast.net>

	* details.c (canvas_pattern): Correct display of antenna patterns.
	There are several different conventions on play here: the FCC
	antenna data assume a cartographer's view of the world, with an
	angle of zero is northward, with increasing angles moving
	clockwise; the trig functions take a mathematician's view that an
	angle of zero is eastward, with increasing angles moving
	counter-clockwise.  The Gnome canvas confuses the issue further by
	adopting the computer graphics convention that y values increase
	toward the bottom of the screen.
	(show_details_window): Added display of lat/lon,
	number of relative towers to details window.
	(pattern_plot): Add a compass rose and the station callsign to the
	antenna pattern display.

2002-07-19  John Kodis  <kodis@comcast.net>

	* details.c (pattern_plot): Specialized out some canvas operations
	into canvas_circle(), canvas_cross(), and canvas_pattern().

	* details.c (show_details_window): Maintain a linked list of
	details windows; handle the window delete and close button clicked
	events to avoid drawing into no longer valid details windows.

2002-05-23  John Kodis  <kodis@jagunet.com>

	* str-to-geoloc.c (geo_get_zip): Look for zipcodes.loc in
	PKGLIBDIR rather than in the current working directory.

	* utils.c (search_set_location): Use str-to-geoloc to translate
	string into geographic location.

2002-05-09  John Kodis  <kodis@jagunet.com>

	* details.c (on_clist_button_release_event): Use the
	button-release event to trigger the display of a details window,
	rather than doing this in response to a row-selected signal.  This
	allows a details window to be drawn on a button-3 event.

2002-04-21  John Kodis  <kodis@jagunet.com>

	* details.c (on_clist_select_row): Use a single window for all
	details pages.

2002-04-17  John Kodis  <kodis@jagunet.com>

	* fcc-lib.c (corf_fmt): Check for overflow when formatting
	corf_str.

	* station-info-cli.c (progress): Twiddle formatting.

2002-03-18  John Kodis  <kodis@jagunet.com>

	* callbacks.c (on_help_activate): Began adding help suppport.

	* fcc-lib.c (open_db_stream): Open {basename}.dat.gz database
	files as well as all the other variations.

2002-03-17  John Kodis  <kodis@jagunet.com>

	* fcc-lib.c (ingest_fac): Capitalize city, street address.
	(fcc_init): Remove call to guess_where(); do this in the main()
	routine instead.  This eliminates the fcc-lib dependency on
	guess_where().
	(db_munge): Initial cut at this binary db output routine.

	* main.c (on_splash_destroy): Set the no_splash flag to avoid a
	segfault after the ingest tracking splash screen is destroyed.

2002-03-12  John Kodis  <kodis@jagunet.com>

	* fcc-lib.c (close_db_stream): Use stream seekability to determine
	whether to pclose or to fclose the stream.

2002-03-11  John Kodis  <kodis@jagunet.com>

	* callbacks.c (search_filter_and_display): New function used by
	on_search and by on_sort to filter and sort station IDs, and to
	display the result.

2002-03-10  John Kodis  <kodis@jagunet.com>

	* fcc-lib.c (fcc_init): Call guess_where() to guess an initial
	location. 

	* station-info-cli.c (progress): Revise reporting of DB ingest
	processing and results.

	* fcc-lib.c (frealloc0): Dynamically allocate storage for DB
	records.

2002-03-09  John Kodis  <kodis@jagunet.com>

	* station-info-cli.c (long_options) utils.c (help): Sync
	up usage and help strings with options.

