
2007-07-07  J. Scott Edwards  <j.scott.edwards.nwos@gmail.com>

	* Version Alpha_24`


2007-07-06  J. Scott Edwards  <j.scott.edwards.nwos@gmail.com>

	* objectify_private.h (nwos_log): move declaration to objectify.h.
	* objectify.h (nwos_log): move declaration from objectify_private.h.
	* log_disc.c (main): add code to log disc_list info.

	* objectify.c (nwos_next_public_ref): moved to disk_io.c.
	(nwos_generate_new_public_id): moved to disk_io.c.
	* disk_io.c (nwos_next_public_ref): moved from disk_io.c.
	(nwos_generate_new_public_id): moved from disk_io.c.
	(nwos_initialize_disk_io): added #ifdef so if in PUBLIC_MODE
	public file is opend read/write instead of read only.  Also
	fix so public file used_blocks is correctly copied into
	nwos_used_public_blocks instead of nwos_used_private_blocks.
	Finally added code to copy nwos_used_public_blocks into
	nwos_next_public_ref.
	(nwos_terminate_disk_io): added #ifndef around declaration of
	chunk_info_size_in_bytes so it isn't defined in PUBLIC_MODE.
	Moved #endif so that "if (chunk_info_modified)" block isn't
	compiled in PUBLIC_MODE.  Finally added #ifdef about lseek
	and write calls so they use the public_file_desc in PUBLIC_MODE.
	(nwos_write_block): Added #ifdef about lseek and write calls so 
	they use the public_file_desc in PUBLIC_MODE.


2007-07-05  J. Scott Edwards  <j.scott.edwards.nwos@gmail.com>

	* log_disc.c (main): changed so that storage locations are
	not predefined in the code, but are added by the user.

	* file.c (nwos_find_disc_copy): added loop to find latest
	version (one with no next).
	(nwos_create_disc_copy): added conditional to move disc if
	the location changed (create a new version of the object).
	* log_disc.c (main): changed assert(result == CREATED_NEW)
	to if statement to say if new copy was created or if the old
	one was simply updated.
	* list_discs.c (main): changed to NOT print copy information
	if a newer version of that object exists.


2007-07-04  J. Scott Edwards  <j.scott.edwards.nwos@gmail.com>

	* disk_io.c (nwos_read_block): Fixed bug when reading from
	compressed file.  When reference IDs were wrapped around the
	disk, they had to be hashed before searching.  Since they are
	no longer wrapped, they just have to be converted to uint32.


2007-07-02  J. Scott Edwards  <j.scott.edwards.nwos@gmail.com>

	* objectify_private.h (Chunk_Info): new structure for
	chunk table stored on disc (formerly chunk_index).
	* objectify.h (RELEASE_VERSION): changed to Alpha_24.
	(VERSION_STRING): changed to 0024.
	(nwos_2_uint8_to_uint16): added new inline function.
	* disk_io.c (chunk_index): changed from uint32* to
	Chunk_Info* and renamed to chunk_info.
	(Bit_Map_Cache_Entry): removed "used" element because the
	blocks used is stored in the chunk_info table.
	(nwos_initialize_disk_io): changed chunk_index to chunk_info,
	chunk_index_modified to chunk_info_modified, and
	chunk_index_size_in_bytes to chunk_info_size_in_bytes.
	Changed to deal with chunk_info as a structure, also read
	and reorder bytes for used blocks in chunk from chunk_info.
	(nwos_terminate_disk_io): changed chunk_index to chunk_info,
	chunk_index_modified to chunk_info_modified, and
	chunk_index_size_in_bytes to chunk_info_size_in_bytes.
	Changed to deal with chunk_info as a structure, also read
	and reorder bytes used blocks in chunk from chunk_info.
	(nwos_hash_uint32_ref):  changed chunk_index to chunk_info
	and changed to deal with it as structure instead of uint32.
	(write_bit_map): added code to count bits set in map and
	verify blocks used count in chunk_info is correct.
	(read_bit_map_into_cache): added code to count bits set in
	map and verify used block count in chunk_info is correct.
	No longer need to update entry->used with used block count
	because it is stored in the chunk_info table.
	(nwos_set_bit_in_map): changed to increment "used" block
	count in chunk_info table instead of cache entry.
	(nwos_clear_bit_in_map): changed to decrement "used" block
	count in chunk_info table instead of cache entry.
	(float chunk_usage): changed to use chunk_info table instead
	of cache entry to compute percentage used in chunk.
	(generate_new_completely_random_id): changed to use "used"
	block count in chunk_info instead of cache entry.  Also
	changed chunk_index to chunk_info and changed to access
	"ref" structure element instead of uint32.
	expand_sparse.c (main): changed to read 0023 compressed file
	with warning, to allow upgrading to 0024.
	check_block_maps (main): added code to verify new "used"
	block counts, in disk layout 0024.

	* INSTALL (Upgrade): added new section on how to upgrade
	from 0021 to 0022, 0022 to 0023, and 0023 to 0024.


2007-07-01  J. Scott Edwards  <j.scott.edwards.nwos@gmail.com>

	* Converted to GPLv3


2007-06-30  J. Scott Edwards  <j.scott.edwards.nwos@gmail.com>

	* Version Alpha_23.1

	* reference_list.c (nwos_add_to_reference_list): added #ifdef
	LOG_REFERENCE_LIST around logging of add to reference list,
	so that it is off by default.


2007-06-29  J. Scott Edwards  <j.scott.edwards.nwos@gmail.com>

	* disk_io.c (nwos_write_block): added #ifdef LOG_WRITE_BLOCK
	around the logging of each write, so that it doesn't log
	block writes by default anymore.

	* disk_io.c (generate_new_completely_random_id): fixed bug
	where byte number was off by 4 (BLOCKS_IN_MAP / 8), so it
	would test for block used in the wrong byte of the bit map
	and sometimes thought a used block was unused.  Then the
	assert(!nwos_block_used()) would assert.


2007-06-28  J. Scott Edwards  <j.scott.edwards.nwos@gmail.com>

	* Version Alpha_23

	* compress_sparse.c (main): modify for 0023 disk layout.

	* disk_io.c (generate_new_completely_random_id): added log
	message to print id's generated (conditionally compiled).
	(nwos_generate_new_1_in_N_id): added log message to print id's
	generated (conditionally compiled).

	* prep_disc.c (main): Fix Segmentation fault when no parameters
	were given on the command line.


2007-06-27  J. Scott Edwards  <j.scott.edwards.nwos@gmail.com>

	* check_block_maps.c (main): Modified to to only check block maps
	that are used, instead of all block maps on the disk.

	* expand_sparse.c (main): added assert to verify that num_blocks 
	stays in sync with nwos_used_private_blocks.

	* expand_sparse.c (main): added code so final messages about
	blocks used and total blocks mismatch are sent to log as well as
	printed to the screen.

	* attic/convert_0022_compressed_to_0023.c (main): added code to
	subtract the number of blocks used for the bit maps from the
	used_blocks.  Layout 0023 doesn't count the blocks used for the
	bit maps in the used_blocks.
	* disk_io.c (nwos_allocate_new_chunk): removed the line to add
	BIT_MAP_BLOCKS to the used_blocks.

	* disk_io.c (nwos_hash_uint32_ref): tweaked the binary search a
	bit to make it cleaner?

	* check_block_maps (main): replaced hard coded constants (256 and
	8192) with defines (FILE_BLOCK_SIZE and BIT_MAP_BYTES).


2007-06-26  J. Scott Edwards  <j.scott.edwards.nwos@gmail.com>

	* disk_io.c (nwos_generate_new_1_in_N_id): fix to handle case
	where block is in invalid chunk (hash == 0).
	* disk_io.c (nwos_set_bit_in_map): add increment of entry->used.
	(nwos_clear_bit_in_map): add decrement of entry->used.
	(generate_random_id): removed function, no longer needed.
	(generate_new_completely_random_id): replaced entire function,
	now picks a random chunk, then a random byte in the bit map, and
	finally a random bit in the word.
	* prep_disk.c (main): add call to allocate a chunk for the root
	object.

	* disk_io.c (Bit_Map_Cache_Entry): add "used" element.
	(read_bit_map_into_cache): moved code to compute number of blocks 
	used from chunk_usage function.
	(chunk_usage): moved code to compute number of blocks used to
	read_bit_map_into_cache function.

	* objectify.c (initialize_random_number_generator)
	(private_generate_new_completely_random_id, generate_random_id)
	(nwos_generate_new_completely_random_id): moved to disk_io.c.
	* disk_io.c  (initialize_random_number_generator)
	(private_generate_new_completely_random_id, generate_random_id)
	(nwos_generate_new_completely_random_id): moved from objectify.c.
	(private_generate_new_completely_random_id): renamed to
	generate_new_completely_random_id.
	* objectify_private.h (private_generate_new_completely_random_id):
	removed.

	* expand_sparse.c (main): verify both used_blocks and used_chunks
	are zero before proceeding.
	(main): disabled import from previous version, must sort the blocks
	for this upgrade using convert_0022_to_0023 program.
	(main): change so storage size doesn't have to be exactly equal,
	just large enough to fit the blocks.
	(main): change to call nwos_allocate_new_chunk if hash returns 0,
	meaning the chunk hasn't been allocated yet.
	(main): print number of chunks used.
	* disk_io.c (nwos_used_private_chunks): new global variable stored
	in disk header.
	(nwos_total_private_chunks): was total_private_chunks variable 
	moved from nwos_hash_uint32_ref function.
	(chunk_index, chunk_index_modified): new static variables.
	(nwos_initialize_disk_io, nwos_terminate_disk_io): added code to
	deal with used_chunks and chunk_index.
	(nwos_allocate_new_chunk): new function to allocate a new chunk of
	disk and add it to the chunk_index (can currently only allocate at
	the end of the allocated chunks).
	(nwos_hash_uint32_ref): changed to calculate block number by looking
	it up in the chunk_index instead of wrapping it around storage size.
	* objectify.h (RELEASE_VERSION): change to Alpha_23.
	(VERSION_STRING): change to 0023.
	* prep_disk.c (print_usage): changed name of parameter from "private
	blocks" to "size" because it is more descriptive.
	(convert_size): add test to make sure at least two chunks are 
	allocated.
	(main): added total_blocks which is blocks used for header (and
	chunk index) plus private chunks.
	(main): set number of blocks used on empty disk to zero, instead of
	number of blocks used in bit maps.
	(main): change to only write private chunks if file, no longer
	necessary to write disk or disk partition since no chunks are used.
	(main): remove float chunks which was used for partial chunks, which
	we no longer do.
	* objectify_private.h (Disk_Header): added "used_chunks" element.
	(RESERVED_PRIVATE_CHUNKS, RESERVED_PRIVATE_BLOCKS)
	(MAXIMUM_VALID_PRIVATE_REFERENCE): added definitions for checking for
	valid private reference, because USABLE_BLOCKS_PER_CHUNK doesn't
	divide evenly into the number of references between 0x10000000 and
	0xffffffff.
	(nwos_total_private_chunks, nwos_used_private_chunks)
	(nwos_allocate_new_chunk): added external references.
	

2007-06-25  J. Scott Edwards  <j.scott.edwards.nwos@gmail.com>

	* Version Alpha_22.3

	* objectify.h (RELEASE_VERSION): change to Alpha_22.3.

	* prep_disk.c (convert_size): fixed bug where it didn't return the
	SIZE_ERROR value even if there was a size error, so prep_disk would
	continue instead of exiting.

	* prep_disk.c (main): moved call to agree_no_warranty after the
	checking of parameters, so that the user doesn't have to agree, only
	to find out that there was an error in the parameters.

	
2007-06-24  J. Scott Edwards  <j.scott.edwards.nwos@gmail.com>

	* Version Alpha_22.2

	* objectify.c (_LARGEFILE64_SOURCE, disk_header, public_file_desc)
	(obj_file_desc, nwos_block_offset_to_chunks, nwos_total_private_blocks)
	(nwos_used_public_blocks, nwos_used_private_blocks, read_only)
	(modified, public_path, storage_index, storage_count, storage_path)
	(special_update_total_blocks_for_expand_0021, nwos_private_space_used)
	(BIT_MAP_CACHE_SIZE, Bit_Map_Cache_Entry, bit_map_cache, bit_map_tick)
	(INDEX_ALLOC_SIZE, index_compressed_file, nwos_hash_uint32_ref)
	(nwos_hash_ref, ref_to_offset, write_bit_map, read_bit_map_into_cache)
	(find_bit_map_in_cache, nwos_set_bit_in_map, nwos_clear_bit_in_map)
	(nwos_test_bit_in_map, nwos_flush_bit_maps, bits_in_byte, chunk_usage)
	(nwos_block_used, nwos_generate_new_closely_spaced_id)
	(nwos_generate_new_1_in_N_id, read_block, nwos_write_block)
	(nwos_remove_object): moved from objectify.c file.
	(USABLE_BLOCKS_PER_CHUNK): moved to objectify_private.h file.
	(storage_path): rename to nwos_private_path.
	(public_path): rename to nwos_public_path.
	(read_block): rename to nwos_read_block.
	(renamed generate_new_completely_random_id) rename to
	private_generate_new_completely_random_id.
	(nwos_initialize_objectify) moved disk io related code to new
	nwos_initialize_disk_io function.
	(nwos_terminate_objectify) moved disk io related code to new
	nwos_terminate_disk_io function.
	* disk_io.c (_LARGEFILE64_SOURCE, disk_header, public_file_desc)
	(obj_file_desc, nwos_block_offset_to_chunks, nwos_total_private_blocks)
	(nwos_used_public_blocks, nwos_used_private_blocks, read_only)
	(modified, public_path, storage_index, storage_count, storage_path)
	(special_update_total_blocks_for_expand_0021, nwos_private_space_used)
	(BIT_MAP_CACHE_SIZE, Bit_Map_Cache_Entry, bit_map_cache, bit_map_tick)
	(INDEX_ALLOC_SIZE, index_compressed_file, nwos_hash_uint32_ref)
	(nwos_hash_ref, ref_to_offset, write_bit_map, read_bit_map_into_cache)
	(find_bit_map_in_cache, nwos_set_bit_in_map, nwos_clear_bit_in_map)
	(nwos_test_bit_in_map, nwos_flush_bit_maps, bits_in_byte, chunk_usage)
	(nwos_block_used, nwos_generate_new_closely_spaced_id)
	(nwos_generate_new_1_in_N_id, read_block, nwos_write_block)
	(nwos_remove_object): moved from objectify.c file.
	(USABLE_BLOCKS_PER_CHUNK): moved to objectify_private.h file.
	(storage_path): rename to nwos_private_path.
	(public_path): rename to nwos_public_path.
	(obj_file_desc): rename to private_file_desc
	(read_block): rename to nwos_read_block.
	(public_path): rename to nwos_public_path
	(nwos_initialize_disk_io): new function make with code from
	nwos_initialize_objectify.
	(nwos_terminate_disk_io): new function make with code from
	nwos_terminate_objectify.
	objectify_private.h (USABLE_BLOCKS_PER_CHUNK): moved from objectify.c.
	(nwos_public_path, nwos_private_path, nwos_initialize_disk_io)
	(nwos_terminate_disk_io, nwos_read_block)
	(nwos_generate_new_closely_spaced_id, nwos_generate_new_1_in_N_id)
	(private_generate_new_completely_random_id): added external references.
	* Makefile (OBJS): added disk_io.o.
	(export_c_structs): added disk_io.c.

	* objectify.c (block_spacing, block_direction, cache, hash_ref_0014)
	(nwos_generate_new_public_id, is_compatible_version, create_object)
	(nwos_set_sequential_blocks, nwos_generate_new_id_in_range): removed,
	unused, #if 0'd out.
	(check_common_header): removed body of function it was #if 0'd out.
	
	* objectify.c (end_of_time): removed, unused.


2007-06-23  J. Scott Edwards  <j.scott.edwards.nwos@gmail.com>

	* Version Alpha_22.1

	* Makefile (uninstall): new rule to remove executables

	* objectify.c (nwos_terminate_objectify): added code to close
	public objects file.

	* prep_disc.c (set_public_root_object): removed 
	#ifndef DONT_COPY_PUBLIC_BLOCKS around this function.
	(main) removed #ifndef DONT_COPY_PUBLIC_BLOCKS
	around code to create private objects, no longer necessary.

	* CHANGE_LOG: renamed to ChangeLog

2007-06-22  J. Scott Edwards  <j.scott.edwards.nwos@gmail.com>
	
	* diff_compressed.c (main): Added special code to convert 0021 file
	to 0022 file.

	* objectify.c (nwos_next_public_ref): uncomment, it is needed when 
	compiled in PUBLIC_MODE.
	(nwos_terminate_objectify): Fixed log of public size.


---------   Everything below here is from the old CHANGE_LOG file: ------------

Alpha_05  2006-01-04

Makefile:

  Removed the create_person and create_phone apps, and created a new app called
  "computer" that is the human interface.


address.c:

  Added the "Direction" class.  Not used yet.


big_bang.c:

  Moved the "create_class_definition" routine out of "big_bang.c" and into a 
  new file "class_definitions.c".  And moved the calls to create various 
  classes such as the person, date, phone, us state, and word classes into 
  those respective files.

  Added code to check for existing objects that are the old version (0004)
  from Alpha_04 and offer to upgrade them to the new version (0005).
  NOTE: it only changes those objects that need to be changed, all other
  objects are left at version 0004.


computer.c:

  New app created out of create_person.c, create_phone.c and find_phone.c 
  apps.


create_person.c, create_phone.c, find_phone.c:

  These apps were all replaced by the "computer" app.


date.c: 

  Removed the count from the month object because it was always two anyway and 
  served no real purpose.

  Added year, month, and date to string functions.

  Added upgrade routine to upgrade 0004 objects to 0005 objects.


name.c: 

  Fixed two bugs in the finding of names.  The first was it set current_top 
  outside of the compare lists loop, so it didn't get reset back to zero when 
  we started over on list [0].  The second was that when it recomputed the 
  num_spellings after compare lists it indexed the reference list with the 
  "word" index instead of [0] which it was computing.

  Fixed bug in matching name object number of words.  It was not correctly
  comparing the number of words, so it would match one with the wrong number
  of words.  For example when searching for "Los Angeles" it would match up
  with "East Los Angeles".

  Changed to allow abbreviations (such as St. for Saint) in names.

  Added debugging printf statements and added asserts.

  Fixed bug where it would try to verify an object against the input 
  parameter when it didn't find an object.

  Added code to make first letter of each word upper case, because now all
  spellings are stored in lower case.


objectify.c:

  Added "is compatible version" routine to determine if a particular version
  of an object is still compatible with the current version.

  Added "is quit command" and "ask yes or no" routines.

  Fixed "ask yes or no" routine so that it works correctly.


objectify.h:

  Removed count from month object.  Since it was always 2, why have it?

  Added external declarations for various routines.

  Added GENDER and US CITY classes.  Added gender variable to person class.

  Changed find_word declaration so that the thing parameter is now a thing
  class parameter.

  Added RESIDENCE, HOUSE, DIRECTION, US ADDRESS, ZIP CODE, STREET NUMBER,
  and STREET classes, which are not used yet in this version. 


person.c:

  Created from create_person.c.


phone.c:

  Moved class creation of phone related classes here from big_bang.c.

  Added phone number creation stuff in part taken from "create_phone.c",
  which has been removed.

  Tweaked the printing of blank lines to make it look better.

  Added "parse phone number" and "parse phone number wo area code" routines
  to deal with phone numbers.

  Reworked the section that deals with problems with phone numbers.

  Added "find phone for person" routine, that finds the phone number for
  a particular person.


spelling.c:

  Changed so that characters are always stored as lower case.

  Added routine to upgrade Alpha_04 objects (0004) to Alpha_05 (0005)
  objects (which consists of changing all the characters to lower case.


us_state.c:

  Moved class creation out of "big_bang.c" and into a new routine here.

  Moved remaining state information (capital city and slogan) from states.txt
  file and into state_info structure.

  Added creation of the US City class.  Added "find state by name", "create
  us city", "add city", and "list cities in state" routines.

  Added routine to add a bunch of additional major cities (only Arkansas,
  Arizona, Alabama, Alaska, California, and a few onther misc. cities are 
  entered in this version).

  Added upgrade routine to upgrade state objects from 0004 to 0005 (which
  meant adding a capital city to each one).  Also called the routine to
  add the addtional cities.


word.c:

  Moved word related class creations out of "big bang" and into a new
  routine here.

  Changed find_word to look for a thing with a certain class instead of a
  certain thing.  I.E. to look for a "month" instead of "January".


