1998-06-17  Aaron Crane  <aaronc@pobox.com>

	* src/autostr.c (astr_null): New function.
	(astr_equal_s, astr_iequal_s, astr_cmp_s, astr_icmp_s): New
 	functions.

1998-06-13  Aaron Crane  <aaronc@pobox.com>

	(throughout): Change sizeof in allocation calls to the object
	being allocated rather than a type.

	* src/darray.c (rquick): Hand-removed the tail-recursive call to
	rquick, because gcc seems unable to do it.  Quite nice really: I
	change an if to a while, and change each of the tail-recursive
	calls to a single assignment.
	(arealloc): I don't quite believe it, but there was a huge memory
	leak here.  Arrgh.

1998-06-08  Aaron Crane  <aaronc@pobox.com>

	* doc/find-funcs.sh: New file: a script which finds the names of
	all functions documented in libretto.texi.  Quite simple, but
	complex enough to need to save it.

	* doc/Makefile.am (EXTRA_DIST): Added find-funcs.sh.

	* src/bstree.c (bst_walk_pre, bst_walk_post): New functions.
	(inorder_walk): Removed the tail-recursion by hand, because gcc
 	can't.

	* doc/libretto.texi: Documented the new functions.  Corrected the
	descriptions of the comparison types -- two of them were still
	down as *_cmp_f instead of *_compare_f.  Added documentation for
	the three missing function pointer types.

1998-05-25  Aaron Crane  <aaronc@pobox.com>

	* src/darray.c (da_apply, da_bsearch_index): New functions.

	* src/autostr-func.c (astr_find_nmatch, astr_find_nmatch_s,
 	astr_find_nmatch_f, astr_find_match, astr_find_match_s,
 	astr_find_match_f, astr_translit, astr_translit_c,
 	astr_translit_s, astr_translit_f): New functions.

	* include/libretto/libretto.h: (Astr_istype_f, Astr_totype_f): New
 	types for ctype functions in find_match/translit functions.

	* doc/libretto.texi: Documented the new functions.

1998-04-20  Aaron Crane  <aaronc@pobox.com>

	* src/chain.c (chain_wipe): New function.

	* doc/libretto.texi: Doc fixes -- added chain_prune; changed
 	bst_find to bst_lookup; changed abuf_cat_str, abuf_copy_str,
 	abuf_insert_str, abuf_find_str to abuf_cat_astr, abuf_copy_astr,
 	abuf_insert_astr, abuf_find_astr.  Oops.

1998-04-17  Aaron Crane  <aaronc@pobox.com>

	* Makefile.am (EXTRA_DIST): add acsite.m4 so other people can be
	developers.  Oops.

1998-03-16  Aaron Crane  <aaronc@pobox.com>

	* src/scan.c.in (scan_func): Fixed bug in scanning a char class
 	%[...] into an autobuf that would have corrupted the autobuf.

1998-03-15  Aaron Crane  <aaronc@pobox.com>

	* src/autobuf.c (substr): Fixed bug that could corrupt malloc
	arena if the substring being copied was bigger than the current
	allocated size of the destination.

1998-03-13  Aaron Crane  <aaronc@pobox.com>

	* src/vasnprintf.c: Included <errno.h> to declare errno.

	* src/libretto.h (__P): Moved definition above the typedefs for
	function pointers.

1998-02-21  Aaron Crane  <aaronc@pobox.com>

	* src/file.c: Renamed fgetgrowline and fgetgrowdelim to
 	file_getline and file_getdelim respectively.  Changed all callers.

	* src/darray.c: Removed da_search and da_rsearch.

	* src/message.h, src/message.c: Great Renaming.  Put a msg_ prefix
 	on these functions.  Changed all callers.

	* src/message.c: Multi-platform support.  See the detailed
	comments at the top of the file.

	* src/message.c (pusage): Took out the buffer initialisation stuff 
	from the function itself.  It's now done with __constructor__ and
	__destructor__ functions to str_initialise a static variable.

1998-02-20  Aaron Crane  <aaronc@pobox.com>

	* acsite.m4, configure.in, Makefile.am, acconfig.h: Move to
 	autoconf, automake and libtool for building.  Moved sources to
 	src/ directory off the top level directory.

	* protos.h: New header file defining __P, __BEGIN_DECLS and
 	__END_DECLS.  This is included by each individual header files,
 	and is catted into the public header at the appropriate point.

	* libretto.h.top, libretto.h.bot: Moved stuff from libretto.h.in
	and the old Makefile into these files.

1998-02-10  Aaron Crane  <aaronc@pobox.com>

	* autobuf.c: Included stringt.h, since we now need prototypes for
	the autobuf functions here, but not in autobuf.h

	* autobuf.h: Removed inclusion of stringt.h, replacing it with a
	forward declaration for `struct string'.

	* str-func.c: Included autobuf.h, since we now need prototypes
	for the autobuf functions here, but not in stringt.h.

	* stringt.h: Removed inclusion of autobuf.h, replacing it with a
 	forward declaration for `struct autobuf'.

1998-02-07  Aaron Crane  <aaronc@pobox.com>

	* autobuf.c (ab_fwrite): Changed calling convention.  Now accepts
 	an `index' argument to say where in the autobuf we should start
 	writing.

	* str-func.c (str_copy_from_ab): New function to coerce the
	textual portion of the data in an autobuf to a string.

	* str-priv.h (terminate_offset): New function, like the old
	`terminate' in str-iof.c.

	* str-iof.c (terminate): Removed this function.

	* stringt.c (str_equal, str_iequal): Cheap performance hack:
	compare the lengths of the strings before comparing the strings
	themselves.

1998-02-06  Aaron Crane  <aaronc@pobox.com>

	* tests/stringt.c (t_substr): Destroyed the string_t variables
	created.

	* autobuf.c: Changed my private `uchar_t' alias for `unsigned
 	char' to `uchar__t'; apparently Solaris defines `uchar_t' in
 	system headers.
	(ab_delete): Removed the idiotic assertion.
	(ab_delete): Fixed the off-by-one error in the loop.

	* message.c (libretto_program_name, libretto_program_short_name):
 	definitions for these variables, which will be valid on all
 	platforms.
	(initialise_progname, finalise_progname): new constructor and
 	destructor functions respectively for handling OS-specific
 	initialisation of libretto_program_name and
 	libretto_program_short_name.  Currently only a version for GNU
 	libc platforms, though code for FreeBSD and SunOS/Solaris exists.

	* message.h: extern declarations for libretto_program_name and
 	libretto_program_short_name.  Removed the declaration for
 	program_invocation_short_name.  It was never documented; the new
	variables should be used instead.  These will be valid on all
	platforms.

1998-01-10  Aaron Crane  <aaronc@pobox.com>

	* Makefile: Added autobufs to the build process.

	* autobuf.h: The `new' file of prototypes for autobufs.

	* autobuf.c: Allegedly a new file, although it's been around in
 	some form since 12 December 1997.  I've tidied it up and put it
 	into the dist officially.

1998-01-05  Aaron Crane  <aaronc@pobox.com>

	* stringt.h: Adjusted prototypes -- see next change.

	* str-func.c (str_set_esc_char): Removed this function.
	(str_esc_char_c): Added new function.  Like `str_esc_char', but
 	includes an argument to specify the character to use.  These
 	changes enable Libretto to be used in multi-threaded apps.

1998-01-04  Aaron Crane  <aaronc@pobox.com>

	* str-iof.c: Renamed from `str_iof.c'.

	* str-func.c: Renamed from `str_func.c'.

	* str-priv.h: Renamed from `str_priv.h'.

	* stringt.h: Added prototype for `str_substr_i'.

	* stringt.c (substr): New inline function to do the substring
	operation.
	(str_substr): Modified to use `substr'.
	(str_substr_i): New function for taking substrings.  Takes a
	substring from one index up to but not including another index,
	unlike the standard function which has an index and a length.

1998-01-03  Aaron Crane  <aaronc@pobox.com>

	* chain.h: Added prototypes for new functions.

	* chain.c (chain_remove): New function to delete an arbitrary node
 	from a chain.
	(chain_move_front, chain_move_back): New functions to move a node
 	to the front or back respectively of a chain.
	
1998-01-01  Aaron Crane  <aaronc@pobox.com>

	* stringt.h: Added prototypes for new functions.

	* stringt.c (str_initialise_s, str_create_s): New functions which
	set contents of a string from a `const char *' at the same time as 
	initialising or creating it.

	* str_func.c (str_upcase, str_downcase, str_capitalise,
 	str_upcase_initials, str_flipcase) New functions for case
 	fiddling.

	* darray.c (da_search): Added flag so warning is printed only
 	once.

	* chain.h (chain_prune_f): Fixed typedef.  Now DATA is non-const,
 	so pruning functions can modify it -- for example, by freeing its
 	data.
	(chain_depose): Removed prototype for non-existent function.

	* chain.c (chlink_nth): Was returning link's data, not the link
 	itself.
	(chain_prune): Was indirecting through pointer to a free
 	chainlink_t.
	(chain_append): New function, synonym for chain_enqueue and
 	chain_back_insert.

	* darray.h: Added prototypes for new functions.

	* darray.c (da_find, da_rfind): New functions for finding things
	in a darray.
	(da_search): Obsoleted.  Calls new function da_find,
	writes warning message.
	(da_rsearch): Obsoleted.  Prints a message and aborts.  Sorry,
	folks.  Use new function da_rfind instead.

1997-12-31  Aaron Crane  <aaronc@pobox.com>

	* stringt.h: Added prototypes for new functions.

	* str_func.c: (str_destroy_all, str_finalise_all) New functions to 
	destroy or finalise respectively several strings at once.

	* darray.h: Added prototypes for new functions.

	* darray.c (atop): New inline function to return address of last
 	element.  Like `da_top'/`da_last'.
	(da_top, da_last): Re-written in terms of `atop'.
	(aresize): New inline function to resize a darray.
	(da_drop, da_pop, da_create_len, da_initialise_len, da_resize,
 	da_insert, da_insert_array): Now use `aresize' when changing the
 	size of an array.
	(apush): New inline function to create a new element at the end of
 	a darray.
	(da_push, da_dup, da_append, da_insert): Now use `apush' when
 	adding an element to the end.
	(acmp): New inline function to compare two elements in the same
 	darray.
	(initialise): New inline function to initialise a darray.
	(da_create, da_initialise, da_create_len, da_initialise_len):
 	Re-written in terms of `initialise'.
	(finalise): New inline function to finalise a darray.
	(da_destroy, da_finalise): Re-written in terms of `finalise'.
	(acat_array): New inline function to cat one array onto the end of
 	another.
	(da_concat, da_insert_array): Now use `acat_array' when catting
 	one array onto the end of another.
	(da_push): Assert that the buffer to copy out of is non-NULL.
	(da_pop): Assert that the buffer to copy into is non-NULL.
	(da_create_len): Assert that the desired length is non-negative.
	(da_equal): New function to compare two darrays for equality.
	(da_insert_array): Actually works this time round -- moves the
 	right number of bytes from where they really were to their correct
 	new location.
	(bin_search): New inline function to do an iterative binary search
 	in a darray with explicit upper and lower limits.
	(da_bsearch): Re-written in terms of `bin_search'.
	(da_bsearch_lim): New function.  Uses `bin_search' to do a binary
 	search with limits.
	(exchange, compare): Removed these useless inline functions.
  	Replaced them with `aswap' and `acmp' respectively -- exchange
	only called `aswap' anyway.
	(find_pivot): May actually compile now, but I haven't tested it.
	It's still surrounded by `#if 0'.

	* tests/Makefile: Now create intermediate objects for the tests.
  	Make them depend on `libretto.h'.  Make the executables depend on
 	the library.  Link the executables against the static library for
 	easier debugging.  Compile the objects with `-fno-inline-functions
 	-g' but no optimisation.
	
1997-12-27  Aaron Crane  <aaronc@pobox.com>

	* stringt.c (str_delete): Really fix it this time.  It should be
	clearer and faster now.  [Thanks Hamish!]

1997-12-27  Aaron Crane  <aaronc@pobox.com>

	* stringt.c (str_copy): Make sure we set the length of the new
	string_t.
	(str_insert_c): Fix off-by-one error when moving characters down.
	(str_delete): Major thinko here -- I was truncating strings, not
	deleting characters from the middle of them.
	(str_substr): Assertion should test INDEX against SRC->length, not 
	DEST->length.
	(str_substr): Fix off-by-one errors in the strncpy() and
	memmove().
