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

	* diff_compressed (main): added call to close the output file.


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

	* rename_file.c (main): added call to nwos_log_arguments.


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

	* list_files.c (main): added --time and --revision options to print
	the modification time of the file and the revision of the file
	respectively.
	(print_time): new function that takes a time stamp and prints the time
	in YYYY-MM-DD HH:MM:SS format.

	* disc_list.c (main): added --add-revision option and call to 
	check_for_previous_version_and_link for each file if enabled.
	(check_for_previous_version_and_link): Feature Request #1856370 - new
	function to check and see if there is a previous file with the same 
	path name and if so to connect prev_version and next_version with newly
	added file.
	
	* disc_list.c (main): added call to nwos_terminate_objectify in
	case where disc list already exists.


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

	* disk_io.c (nwos_read_block): change assert to more descriptive print
	statements when we fail to find a block in the storage_index.


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

	* disk_io.c (nwos_terminate_disk_io): commented out statement that
	nulled out the public_path.  It prevented eliminate_one_block_chunks
	program from firing up objectify the second time.


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

	* Version Alpha_26.2

	* backup.c (nwos_initialize_backup): fixed error where BACKUP_LOCATION
	constant was used instead of 'backup_location' parameter.

	* backup.c (sort_file): commented out print statements about duplicate
	blocks.  Added code to write a log message when duplicate blocks are
	found.


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

	* backup.c (nwos_initialize_backup): changed file extension from '.bak'
	to '.dif'.  Decided to use .bak for a different kind of file.


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

	* objectify.c (nwos_set_security_level): wrapped in #ifndef PUBLIC_MODE
	so it isn't compiled in when PUBLIC_MODE is defined.
	(nwos_read_object_from_disk_and_decrypt): added conditionally compiled
	code that when PUBLIC_MODE is defined it just copies the object from
	the buffer with no encryption.
	(nwos_write_object_to_disk_and_encrypt): added conditionally compiled
	code that when PUBLIC_MODE is defined it just copies the objecti into
	the buffer with no encryption.


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

	* expand_sparse.c (main): add call to close backup file because we
	don't want to write a backup file when restoring.

	* backup.c (nwos_backup_write_block): add test so it won't write to the
	backup file unless it is open.  Also fix so it closes the file after an
	error occurs.

	* patch_compressed.c (main): fix comparison of reference ids.


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

	* combine_backup_files.c (read_next_file_chunk): changed to set
	num_blocks to zero if already at end of file.
	(main): change to call read_next_file_chunk before deciding if it is
	the end of the file so that if the file size is exactly the buffer size
	it works correctly.

	* combine_backup_files.c (MAX_FILES): increased to 64.
	(read_next_file_chunk): new function to read more of the file in, when
	the file is larger than MAX_BUFFER_SIZE.
	(main): added code to deal with files larger than MAX_BUFFER_SIZE.

	* Makefile.in (combine_backup_files): added new program.


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

	* combine_backup_files.c: new program that combines multiple backup
	files into one diff file.

	* patch_compressed.c (version_string_to_int): new function that
	converts a version string, like "0027" to an integer.
	(main): added code to test to see if the files being diff'd are older
	than 0023 and if so insert the next reference into bytes 0 to 3 of the
	block, which was needed when the reference id's wrapped around storage.
	If they are newer then don't bother with the next_reference.


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


	* backup.c (nwos_initialize_backup): change to use "objectify" for the
	backup file name instead of the username.


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

	* backup.c (sort_file): initialize read_offset to zero so the compiler
	doesn't complain about it being used uninitialized.

	* backup.c (nwos_terminate_backup): added test to make sure it was
	modified before complaining about no backup.

	* disk_io.c (nwos_initialize_disk_io, nwos_terminate_disk_io)
	(nwos_write_block): added #ifndef NO_BACKUP around call to
	backup functions.  This way we don't need to include backup.c when
	compiling export_c_structs.
	* Makefile.in (export_c_structs): add -DNO_BACKUP so disk_io.c doesn't
	make any calls to backup.c.


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

	* backup.c (sort_file): added code to deal with duplicate blocks.


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

	* backup.c (sort_file): added the code to handle the case where the
	file to be sorted is larger than the sort buffer.

	* backup.c (sort_file): moved test for error after read in sort loop
	outside of the loop.  This way we can skip the writing if there was a
	read error.

	* backup.c (sort_file): added malloc call for buffer which was
	accidentally lost in moving code from one file to another.  Removed
	line that set backup_file_desc to -1 since file hasn't been closed yet.
	(nwos_terminate_backup): added printing of how long sort_file() took.
	Set backup_file_desc to -1 after file is closed.  Added call to free
	nwos_backup_path which was malloc'd in nwos_initialize_backup.


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

	* backup.c (compare_id): added new to compare two reference IDs and
	return the difference.
	(sort_file): added new to sort the blocks in the backup file into the
	proper order (incomplete, cannot deal with a file larger than 1 MB).
	(nwos_terminate_backup): changed to call the sort_file function.

	* Makefile.in: added backup.o to OBJS.
	* objectify_private.h (nwos_initialize_backup, nwos_terminate_backup)
	(nwos_backup_write_block): added new externs for backup.c.
	* backup.c (nwos_initialize_backup, nwos_terminate_backup)
	(nwos_backup_write_block): new functions created from code taken from
	disk_io.c.
	* disk_io.c (nwos_backup_path, backup_file_desc): moved to backup.c.
	(initialize_backup_file, terminate_backup_file): moved functions to new
	file: backup.c.
	(nwos_initialize_disk_io): changed name of function call to initialize
	backup.
	(nwos_terminate_disk_io): moved code to deal with backup file to
	disk_io.c changed name of function call to terminate backup.
	(nwos_write_block): moved code to write backup file to new function in
	backup.c.

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

	* disk_io.c (terminate_backup_file): created from code taken from
	nwos_terminate_disk_io to finish writing and close backup file.
	(nwos_terminate_disk_io): move code to finish writing and close backup
	file into new terminate_backup_file function.


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

	* disk_io.c (nwos_backup_path, backup_file_desc): added new for
	backup file.
	(initialize_backup_file): new function to setup and open backup file.
	(nwos_initialize_disk_io): added call to initialize_backup_file if
	opening is not read_only.
	(nwos_terminate_disk_io): added code to finish writing to backup file
	and close it.
	(nwos_write_block): added code to write block to backup file if it is
	open.

	* config.h.in (BACKUP_LOCATION): add new to define the location for
	backing up changes (directory or host).


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

	* Version Alpha_26.1

	* config.h.in (DEFAULT_FILE): changed preconfigured default file to
	/var/db/objectify/private.obj so that if someone wants to use the
	config.h.in as is they just have to create that file.

	* import_file.c (display_usage): new function to display usage info.
	(main): added calls to display_usage when needed.


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

	* disk_io.c (nwos_generate_new_closely_spaced_id): fix to handle the
	case where the block estimate will fit in one chunk.

	* disk_io.c (nwos_generate_new_closely_spaced_id): renamed 'max_usable'
	variable to 'max_used' because that better represents the value that is
	stored in it.

	* disk_io.c (nwos_allocate_all_chunks_hack): added new to allocate all
	available chunks.
	* prep_disk.c (main): added --allocate-all option that calls the new
	nwos_allocate_all_chunks_hack function in disk_io.c to allocate ALL of
	the blocks that we just preped.  This is a temporary hack until I can
	fix all of the allocation the right way.

	* disk_usage.c (main): rearranged block/chunk usage output format yet
	again.

	* disk_usage.c (calculate_blocks_used): changed parameters so
	chunk_info and number of used chunks is passed in.  Changed to use
	chunk_info.index to read bit maps from disk.  Finally compare used
	block count in chunk_info table with block count calculated from bit
	map.
	(main): changed call to calculate_blocks_used to pass chunk_info table
	and number of chunks used instead of total number of blocks.	

	* disk_usage.c (chunk_counts): removed no longer used.
	(calculate_blocks_used): removed old unused (commented out) code.
	(main): removed old #ifdef'd and commented out code.

	* disk_usage.c (calculate_blocks_used): changed variable 'ref'
	to 'block' to be consistent with usage in disk_io.c.

	* disk_usage.c (main): added code to read in chunk_info table.


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

	* disk_usage.c (main): changed output of chunks and blocks into a
	table.

	* disk_usage.c (main): added printing of chunks (total, system,
	allocated, free) and blocks used by system.


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

	* disk_usage.c (main): changed printout of results to also print
	amounts in megabytes or gigabytes, in addition to number of blocks.


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

	* configure.ac (strlcat, strlcpy): added to AC_CHECK_FUNCS.
	* config.h.in (HAVE_STRLCAT, HAVE_STRLCPY): added undefs for.
	* objectify.h (strlcat, strlcpy): instead of #ifdef linux,
	changed to use autoconf generated HAVE_STRLCAT and HAVE_STRLCPY.
	* log.c (strlcat, strlcpy): instead of #ifdef "linux", test for
	not HAVE_STRLCAT and HAVE_STRLCPY.


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

	* configure.ac (stat struct stat.st_mtimespec) added test for.
	* config.h.in (HAVE_STRUCT_STAT_ST_MTIMESPEC) added undef for.
	* file.c: changed from testing for "linux" to testing for not
	HAVE_STRUCT_STAT_ST_MTIMESPEC.


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

	* disk_io.c (nwos_set_allocation_parameters)
	(nwos_check_blocks_available): moved from beginning of file to a
	location by the ID generation functions.  NO code changes.


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

	* objectify_private.h (nwos_generate_new_closely_spaced_id)
	(nwos_generate_new_1_in_N_id): removed 'last_ref' parameter.
	* objectify.c (last_ref, nwos_restart_id_generation): moved to
	disk_io.c.
	(nwos_generate_new_id): removed last_ref parameter in calls to
	nwos_generate_new_closely_spaced_id and nwos_generate_new_1_in_N_id.
	* disk_io.c (last_ref, nwos_restart_id_generation): moved from
	objectify.c.
	(nwos_generate_new_closely_spaced_id, nwos_generate_new_1_in_N_id):
	removed 'last_ref' parameter (now a global variable in disk_io.c)
	and added copy from 'new_ref' to 'last_ref' at the end.

	* objectify.h (nwos_push_security_level, nwos_pop_security_level):
	removed no longer used.
	* objectify.c (nwos_push_security_level, nwos_pop_security_level):
	removed no longer used.  This simplifies moving last_ref to the
	disk_io module.

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

	* time_stamp.h: added include of sys/time.h because some platforms
	need it to define struct timeval.

	* disk_io.c (nwos_check_blocks_available): added code to allocate
	more chunks if they are available following all of the already
	allocated chunks.  This version CANNOT allocate chunks before or
	in the middle of already allocated chunks.


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

	* objectify.c (SECURITY_VERY_LOW_N, SECURITY_LOW_N)
	(SECURITY_MEDIUM_N, SECURITY_HIGH_N): changed the values so they
	are spread out more.  Probably doesn't make any difference but all
	are prime numbers.  Also halved the chunk skipped range for medium
	and high security levels because they are plus and minus, so now
	the range is quadrupled each step up in security.

	* objectify_private.h (nwos_set_allocation_parameters): added
	external declaration.
	* disk_io.c (chunk_density_target, chunk_skip_backward)
	(chunk_skip_forward): added new file global variables.
	(nwos_set_allocation_parameters): added new function to store chunk
	density and number of chunks that can be skipped forward and back.
	(nwos_check_blocks_available): added asserts to verify the chunk
	density and skip values are set and within limits.  Also added
	check to verify there are enough chunks allocated.
	* objectify.c (SECURITY_VERY_LOW_N, SECURITY_LOW_N)
	(SECURITY_MEDIUM_N, SECURITY_HIGH_N): new defines to configure how
	dense blocks are for a particular security level.
	(set_security_level): new function that is called by the higher
	level nwos_set_security_level functions to set a security level,
	that calls the new nwos_set_allocation_parameters in disk_io.c.
	(nwos_set_security_level, nwos_push_security_level)
	(nwos_pop_security_level): changed to call the 
	new set_security_level function to set the level so it can call
	the new nwos_set_allocation_parameters in disk_io.c.
	(nwos_generate_new_id): changed to use new SECURITY_XXX_N defines
	instead of hard coded numbers.


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

	* disk_io.c (calculate_chunk_density): changed to just search back
	from the end and renamed to 'find_first_low_density_in_chunk'.

	* disk_io.c (CHUNK_FACTOR): changed to BYTES_PER_SLICE.


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

	* configure.ac: changed version to Alpha_26.1 and added define for
	OLDEST_COMPATIBLE_COMPRESSED_VERSION.
	* configure: regenerated because of Alpha_26.1 and other changes to
	configure.ac.
	* config.h.in: added #undef OLDEST_COMPATIBLE_COMPRESSED_VERSION.
	* disk_io.c (nwos_initialize_disk_io): added code to allow an older
	compressed file to be read in when it is compatible.

	* Makefile.in (distclean): changed to depend upon 'clean' instead
	of 'clean_all' because 'clean_all' removes the Makefiles before
	they can be used to do the dist clean.


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

	* disk_io.c (calculate_chunk_density): new function to determine if
	a chunk is imbalanced (more used blocks in one part than another.
	(find_starting_chunk): new function to find a chunk that the blocks
	needed will fit into.


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

	* import_file.c (main): added call to 'nwos_restart_id_generation'
	function so each file starts with a fresh ID.
	* objectify.c (last_ref): move from static variable from inside the
	'nwos_generate_new_id' to global at file level.
	(nwos_restart_id_generation): added new to clear the 'last_ref'
	variable.
	(previous_ref): added new to keep value of 'last_ref' when security
	level is pushed.
	(nwos_set_security_level): added a call to void 'previous_ref' and
	a call to 'nwos_restart_id_generation' to start ID generation fresh
	for the new security level.
	(nwos_push_security_level): added a call to save 'last_ref' into
	'previous_ref' so it can be restored when the security level is 
	popped and a call to 'nwos_restart_id_generation' to start ID 
	generation fresh for the new security level.
	(nwos_pop_security_level): added a call to restore 'last_ref' from
	'previous_ref' and a call to void 'previous_ref' since it is no
	longer required.
	* objectify.h: added external declaration for new
	'nwos_restart_id_generation' function.

	* Makefile.in (distclean): added calls to Makefile in the three
	sub-directories: md5, sha1, and sha256.
	* md5/Makefile.in (distclean): added new target that does everything
	clean_all does plus removes the backup files ending in '~'.
	* sha1/Makefile.in (distclean): added new target that does everything
	clean_all does plus removes the backup files ending in '~'.


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

	* import_file.c (main): renamed 'nwos_set_block_estimate' to
	'nwos_check_blocks_available' and if it returns false skip that file.
	* prep_disk.c (main):  renamed 'nwos_set_block_estimate' to
	'nwos_check_blocks_available' and assert if it returns false.
	* computer.c (space_available); new function to call newly renamed
	'nwos_check_blocks_available' function and print message about not 
	completing command.
	(execute_command): changed to call new 'space_available' function
	instead of previously named 'nwos_set_block_estimate' and not execute
	command if it returns false.
	* rename_file.c (main): renamed 'nwos_set_block_estimate' to
	'nwos_check_blocks_available' and if it returns false exit gracefully.
	* log_disc.c (main): renamed 'nwos_set_block_estimate' to
	'nwos_check_blocks_available' and if it returns false exit gracefully.
	* disc_list.c (main): renamed 'nwos_set_block_estimate' to
	'nwos_check_blocks_available' and if it returns false exit gracefully.
	* add_password.c (main): renamed 'nwos_set_block_estimate' to
	'nwos_check_blocks_available' and if it returns false exit gracefully.
	* objectify.h (nwos_set_block_estimate): renamed function to
	'nwos_check_blocks_available' and to return a boolean value.
	* disk_io.c (nwos_set_block_estimate): changed function name to
	'nwos_check_blocks_available' and to return a boolean value, true if
	there was space for the blocks and false if not.  Also added code to
	print various values if it fails to stderr.

	* Makefile.in (distclean): new target that does everything clean_all
	does plus config.status, config.log and backup files ending in '~'.


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

	* Version Alpha_26

	* rename.c (main): fix compiler warning, "no_history" could be used
	uninitialized.


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

	* log.c (append_date_from_time_string): Bug #1806945 - fixed least
	significant digit of month in log file name, when month number is 
	greater than 9.


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

	* rename_file.c (main): added option to do the rename the was it was
	done in revision 1.5 and before, by overwriting the string in the path
	object.

	* rename_file.c (main): added variables for old and new names and
	changed code to use them to access arguments instead of using argv[1]
	and argv[2] explicitly.

	* rename_file.c (main): removed code that did the creation of the new
	name into a separate function called 'create_new_path'.
	(create_new_path): new function created with code moved from 'main.


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

	* export_file.c (main): change the order of testing for file name
	match and old (renamed) file names.  Before it would read the
	association object for every single file, test for an old file name,
	and then see if the file name matched the argument.  Now it tests
	for an argument match with the name and if it doesn't match it
	doesn't read the association object at all.  The time for reading a
	single file (with 4441 files in the system) went from 5 minutes and
	28 seconds (328 seconds) to 17.5 seconds, 18 times faster.


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

	* remove_file.c (main): added warning about making a backup and
	require verification before removing file.

	* remove_file.c: removed warning comment about not being fully
	functional, should work in most cases now.
	(print_md5, print_sha1): removed, were not used.
	(main): removed do_md5 and do_sha1 variables that weren't used.

	* reference_list.c (nwos_remove_from_reference_list): fixed the case
	where the entry that needs to be removed is in the first block but
	there are extra blocks that have to be fixed.

	* reference_list.c (nwos_remove_from_reference_list): added function
	header comment with explanation about different cases that occur when
	removing an entry.  Also added and changed some comments in the code.
	NO code changes were made.


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

	* reference_list.c (nwos_remove_from_reference_list): added code to
	deal with moving entries down through extra blocks and writing them
	to disk.

	* remove_file.c (main): the previous change was a mistake, put the SHA1
	code back the way it was (there is always a SHA1 sum) and added code to
	deal with a SHA256 sum if it exists (as on all newer files).

	* remove_file.c (main): added test to make sure a file has a SHA1 sum
	before removing it, to handle the case of an old file that was created
	without a SHA1 checksum.

	* reference_list.c (nwos_remove_from_reference_list): changed code to
	deal with removing a block that only had one entry, when the previous
	block had the entry.

	* reference_list.c (nwos_remove_from_reference_list): added code to
	deal with removing a block that only had one entry, when that block is
	beyond the second block.

	* objectify_private.h (Ref_List_First_Block, Ref_List_Extra_Block):
	added ivec variable to save ivec data before block was read or written.
	* reference_list.c (Block_Cache): removed ivec variable because it is
	now part of the first block and extra block structures.
	(read_ref_list_into_cache): modified asserts that verify that the size
	of the first and extra block structures is what we expect.  Change to
	access the next ivec storage in the first and extra block structures,
	instead of cache->ivec.
	(write_reference_list): change to point to block->ivec instead of
	cache->ivec.
	(nwos_create_reference_list_with_existing_id): change to set ivec in
	first block to zero instead of setting cache->ivec to zero.
	(nwos_add_to_reference_list): change to use local variable for ivec
	and copy it in and out of ivec in block structures.
	(nwos_remove_from_reference_list): removed two calls to set cache->ivec
	to zero because ivec in first block should always be zero.

	* reference_list.c (nwos_remove_from_reference_list): added code to
	deal with the special case where there are two blocks in the reference
	list and the second one only has one entry and that entry is the one
	that needs to be removed.

	* config.h.in (TEST_PASS_PHRASE): added for testing purposes, to keep
	from having to type it in everytime.
	* prep_disk.c (main): added #ifndef TEST_PASS_PHRASE around code asking
	for input from user, so it will just blindly plow ahead.
	* security.c (nwos_get_key_from_password): added conditional code based
	upon TEST_PASS_PHRASE to automatically fill in pass phrase from it, if
	it is defined.

	* reference_list.c (nwos_remove_from_reference_list): added code to
	deal with the case where the entry to be removed is in the first block
	and there is only one entry in the second block (so the second block
	can be eliminated).  Also added assert to check for only one entry in
	the last block, since the mulitple block code cannot deal with
	eliminating the last block yet.


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

	* reference_list.c (nwos_remove_from_reference_list): removed unused
	ivec local variable.

	* reference_list.c (nwos_remove_from_reference_list): changed so that
	when an entry is removed from a reference list that fits in one block
	it moves all of the ones above it down instead of copying the last one
	over the top of it (thereby changing the order).


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

	* reference_list.c (nwos_remove_from_reference_list): added code to
	remove an entry from the list as long as it is in the last block.


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

	* objectify.h (nwos_set_block_estimate, nwos_estimate_blocks_for_file):
	added external declarations.
	* disk_io.c (block_estimate, last_used_blocks): new static variables
	for the block estimate stuff.
	(log_estimate_results): new static function that prints the results of
	the block estimate (estimated and actual).
	(nwos_set_block_estimate): new function to save the block estimate.
	* file.c (nwos_estimate_blocks_for_file): added new function to
	estimate the number of blocks that will be needed to store a file.
	* add_password.c (main): added call to set block estimate.
	* computer.c (execute_command): added calls to set block estimates.
	* disc_list.c (main): added call to set block estimate.
	* import_file.c (main): added calls to set block estimate for each
	file.
	* log_disc.c (main): added call to set block estimate.
	* prep_disk.c (main): added call to set block estimate.
	* rename_file.c (main): added call to set block estimate.

	* phone.c (nwos_find_private_area_code): Bug #1786616 - changed to call
	'find_or_create_private_class' to get Area Code class, instead of just
	'find_private_class' so it will create the private Area Code class if
	it doesn't already exist.
	(nwos_find_or_create_private_area_code): changed return value to bool,
	and return true if it was found or if it was created.
	(nwos_create_phone_number): Bug #1786619 - changed to call
	'nwos_find_or_create_private_area_code' instead of
	'nwos_find_private_area_code' because if the private area code doesn't
	exist it must be created.


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

	* import_file.c (encryption_options): changed to security_options
	to match up with previous changes made on 2007-08-12  (missed this).
	(main): changed 'encryption_options' to 'security_options' and changed
	print statement to say "setting security level to:" instead of
	"setting encryption level to:".


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

	* disk_io.c (write_bit_map, read_bit_map_into_cache): added #ifdef
	LOG_BIT_MAP around log messages so they are not logged in a normal
	build.


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

	* reference_list.c (nwos_add_to_reference_list): added #ifdef
	LOG_REFERENCE_LIST around two more log messages so they are not
	logged in a normal build.


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

	* export_file.c (main): added code to test for old (renamed) file names
	and not match wild cards if it is an old name.  If the old name is
	explicitly given (exact match, no wild card) it will export it.


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

	* doc/Document_Storage.txt: added this brief explanation of how I
	use the system to store my documents.

	* list_files.c (main): added --list-old-files option to print the
	old names of files that have been renamed, if the option isn't given
	the old names are not listed in the output.

	* file.c (nwos_number_of_files_for_path): corrected an incorrect
	comment about the return value.  NO code changes!

	* rename_file.c (file_is_used_in_disc_list): changed to pass pointer
	to Path and File Association object instead of disc_list reference,
	because 'main' now reads it.  Moved code to read the association
	object to 'main'.
	(main): changed to do rename a completely different way.  Instead of
	just changing the name string in the Path object, it creates a new
	Path object and a new Path and File Association object and leaves the
	old ones intact.  It sets the 'next_version' and 'prev_version' in
	the old and new association objects to point to each other.
	* objectify.h (nwos_create_file_path): added external declaration for.


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

	* rename_file.c (main): added test to print error and exit if the new
	path (file name) already exists in the system.

	* rename_file.c (main): changed to only call file_is_used_in_disc_list
	if a private disc_list class exists, otherwise there are no disc_lists 
	in the system.
	(file_is_used_in_disc_list): changed to pass disc_list class reference
	into the function because main has already read it to determine if any
	disc_lists exist in the system.

	* rename_file.c (main): moved code that checked to see if a certain
	file name (path) was used in a disc_list into a separate function.
	(file_is_used_in_disc_list): new function created from code taken from
	main.

	* rename_file.c (main): added code to print the disc list ID number
	instead of it's reference when file is listed in a disc list.

	* rename_file.c: new program to changing a file name (with certain
	restrictions).
	* Makefile.in: (rename_file): added.


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

	* list_files.c (main): removed reading File Path class reference
	because it isn't used.  Changed to emit error message when there isn't
	a private File and Path class defined (no files exist) instead of
	asserting.

	* export_file.c (list_all): removed function, no longer needed.
	(export_list): renamed to "export_file" and removed loop so it only
	processes one file.
	(main): added loop to pass all arguments through the file name match
	function to do name globbing and if there is a match call the 
	export_file function.


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

	* list_files.c (print_sha256): fixed to deal with the case where the
	sha256sum is void (no SHA256 sum was calculated for this file).

	* list_files.c (print_sha256): new function to print SHA256 checksum.
	(main): added code to add option for printing the SHA256 checksum.
	* export_c_structs.c (output_class): changed code that checked for
	"Sha1" to check for "Sha" and any number, so it will match Sha1,
	Sha256, or Sha512.
	* file.c: add include of sha256/sha256.h.
	(nwos_find_sha256, nwos_create_sha256): new functions to find and
	create SHA256 checksum objects, created from SHA1 functions.
	(checksum_file, read_file): added code to calculate SHA256 checksum in
	addition to MD5 and SHA1.
	(nwos_create_file_without_storing_data, nwos_add_new_revision_of_file)
	(nwos_create_file): added code to create a SHA256 checksum object in 
	addition to the MD5 and SHA1 objects and store it in the File object.
	(nwos_find_matching_file_from_size_md5_sha1): added code to also
	verify SHA256 checksum if the file object contains one.
	(nwos_find_matching_path_and_file_association): added code for SHA256
	checksum in addition to MD5 and SHA1.
	* configure.ac (AC_CONFIG_FILES): added sha256/Makefile.
	* Makefile.in (sha256): added new target.
	(libobjectify.a): added sha256.o.
	(clean_all): added clean sha256 directory.
	* sha1/sha1.h: upgraded to GNU coretutils-6.9.
	* sha1/sha1.c: upgraded to GNU coretutils-6.9.
	* sha1/Makfile.in (sha1.o): removed dependency on md5.h which is no
	longer required in coreutils-6.9.
	* sha256/sha256.h: copied from GNU coretutils-6.9.
	* sha256/sha256.c: copied from GNU coretutils-6.9.
	* sha256/Makfile.in: created fromm sha1/Makefile.in.


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

	* file.c (nwos_find_file_path, nwos_create_file_path)
	(nwos_find_md5, nwos_find_matching_file_from_size_md5_sha1)
	(nwos_create_md5, nwos_create_file_without_storing_data)
	(nwos_find_sha1, nwos_find_path_and_file_association)
	(nwos_create_sha1,nwos_find_or_create_path_and_file_association):
	added conditional code for PUBLIC_MODE so it can be used to create
	public file objects.
	* attic/log_public_file: new file to create files in the public
	objects.


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

	* disk_io.c (nwos_generate_new_closely_spaced_id): corrected value
	passed to find_bit_map_in_cache to include offset_to_chunks.

	* disk_io.c (nwos_generate_new_closely_spaced_id): replaced
	BIT_MAP_BYTES with BIT_MAP_BLOCKS in two places where calculation
	was based on blocks and not bytes.


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

	* add_password.c (main): add call to allocate the chunk for the new
	password root object.

	* disk_io.c (generate_new_completely_random_id): fix bug that occurred
	when only one chunk had been allocated, but it wasn't the first chunk.
	The problem was that the chunk index was not used when there was only
	one chunk, so if that one chunk was not the first chunk (0) it failed.

	* objectify.h (Encryption_Level): renamed to 'Security_Level'.
	(nwos_set_encryption_level): renamed to 'nwos_set_security_level'.
	(nwos_push_encryption_level): renamed to 'nwos_push_security_level'.
	(nwos_pop_encryption_level): renamed to 'nwos_pop_security_level'.
	* objectify.c (encryption_level): renamed to 'security_level'.
	(previous_encryption_level): renamed to 'previous_security_level'.
	(nwos_set_encryption_level): renamed to 'nwos_set_security_level' and
	renamed enumerated 'Encryption_xxx' values to 'Security_xxx'.
	(nwos_push_encryption_level): renamed to 'nwos_push_security_level' and
	renamed enumerated 'Encryption_xxx' values to 'Security_xxx'.
	(nwos_pop_encryption_level): renamed to 'nwos_pop_security_level' and
	renamed enumerated 'Encryption_xxx' values to 'Security_xxx'.
	(nwos_generate_new_id): renamed enumerated 'Encryption_xxx' values to 
	'Security_xxx'.
	* import_file.c (encryption_options): changed 'level' from
	'Encryption_Level' to 'Security_Level' because the type was renamed and
	renamed enumerated 'Encryption_xxx' values to 'Security_xxx'.
	(main): renamed 'nwos_set_encryption_level' calls to
	'nwos_set_security_level'.
	* log_disc.c (main): renamed call to 'nwos_set_encryption_level' to 
	'nwos_set_security_level' and enumerated value 'Encryption_Very_Low' to
	'Security_Very_Low'.
	* disc_list.c (main): renamed call to 'nwos_set_encryption_level' to 
	'nwos_set_security_level' and enumerated value 'Encryption_Very_Low' to
	'Security_Very_Low'.
	* computer.c (main): renamed call to 'nwos_set_encryption_level' to 
	'nwos_set_security_level' and enumerated value 'Encryption_Extreme' to
	'Security_Extreme'.
	* add_password.c (main): renamed call to 'nwos_set_encryption_level' to 
	'nwos_set_security_level' and enumerated value 'Encryption_Extreme' to
	'Security_Extreme'.
	* prep_disk.c (main): renamed call to 'nwos_set_encryption_level' to 
	'nwos_set_security_level' and enumerated value 'Encryption_Extreme' to
	'Security_Extreme'.
	* verify_file.c: removed call to 'nwos_set_encryption_level' because it
	doesn't create any objects, it doesn't need to set the security level.


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

	* file.c (nwos_create_file): removed code that set security level to
	Extreme before calling nwos_create_file_path so that the path is
	created in the desired security level.

	* disk_io.c (nwos_generate_new_closely_spaced_id): completely rewritten
	to work with the new chunk stuff.


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

	* config.h.in: added #undef HAVE_STDINT_H so it could be removed from
	Makefile.in files.
	* Makefile.in: removed -DHAVE_STDINT_H, now defined in config.h.
	* sha1/Makefile.in: removed -DHAVE_STDINT_H, now defined in config.h.
	
	* types.h (off_t, lseek, O_LARGEFILE): removed conditional definitions
	for these that were to cope with 64 bit file system junk.  Now using
	_FILE_OFFSET_BITS = 64 to do the 64 bit file stuff on Linux.
	* Makefile.in (CFLAGS): added -D_FILE_OFFSET_BITS=64.
	* check_block_maps.c (_LARGEFILE64_SOURCE, O_LARGEFILE): removed.
	* compress_sparse.c (_LARGEFILE64_SOURCE, O_LARGEFILE): removed.
	* diff_sparse.c (_LARGEFILE64_SOURCE, O_LARGEFILE): removed.
	* disk_io.c (_LARGEFILE64_SOURCE, O_LARGEFILE): removed.
	* disk_usage.c (_LARGEFILE64_SOURCE, O_LARGEFILE): removed.
	* expand_sparse.c (_LARGEFILE64_SOURCE): removed.
	* prep_disk.c (_LARGEFILE64_SOURCE, O_LARGEFILE): removed.
	* file.c (_LARGEFILE64_SOURCE): removed.  Also added LL to long long
	constants.
	

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

	* disk_io.c (Bit_Map_Cache_Entry): changed 'chunk' element to 'index.
	(write_bit_map, read_bit_map_into_cache, find_bit_map_in_cache)
	(generate_new_completely_random_id, nwos_generate_new_1_in_N_id):
	changed to use index into chunk_info from bit map cache instead of
	chunk.
	(chunk_index_to_info_index): new function to find the chunk_info index
	from the chunk_index.
	(nwos_set_bit_in_map, nwos_clear_bit_in_map): change to use the new 
	'index' into the chunk_info to increment or decrement the used block 
	count instead of trying to calculate the index into chunk_info.
	(nwos_generate_new_closely_spaced_id): this function is broken, cannot
	be used yet.
	
	* disk_io.c (nwos_generate_new_1_in_N_id): changed name of 'block'
	variable to 'ref' because it is more descriptive (it is not a block
	number).

	* types.h (bool8, bool16): added.
	* disk_io.c (Bit_Map_Cache_Entry): changed 'dirty' from bool to
	bool8 and added bool8 'in_use' variable.
	(nwos_terminate_disk_io, nwos_flush_bit_maps): changed to use new 
	'in_use' element to determine if bit map cache entry is used instead of
	'chunk' non zero.
	(read_bit_map_into_cache): added code to set 'in_use' element to
	true when entry is read in.
	(find_bit_map_in_cache): changed to test 'in_use' before testing
	'chunk' and check for not 'in_use' to find empty instead of 'chunk'
	being zero.


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

	* disk_io.c (nwos_hash_uint32_ref): removed code that does binary
	search of chunk_info table.
	(uint32_ref_to_info_index): new function created with code taken
	from nwos_hash_uint32_ref that does the binary search and returns
	the index into the chunk_info table.


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

	* disk_io.c (nwos_generate_new_1_in_N_id): changed so that instead of
	picking 1 block out of every N blocks, it just picks a random number
	between 1 and N and adds it to the previous block number.
	* objectify.c (nwos_generate_new_id): change values used to call 
	nwos_generate_new_1_in_N_id to 7 (very-low), 19 (low), 43 (medium),
	and 113 (high).
	* import_file.c (encryption_options): added "high" security option.


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

	* objectify.c (nwos_generate_new_id): change default encryption level
	to None instead of High (which wasn't used before).  Changed low and
	medium levels from skip 64 and 512 to 32 and 128 respectively.  Made 
	high level skip 512 (what medium was before). 

	* compress_sparse.c (main): change to use the new index in the
	chunk_info table to compute the address of the chunk on disk.
	* disk_io.c (nwos_allocate_new_chunk, nwos_hash_uint32_ref): change to
	use the new index in the chunk_info table to compute the address of the
	chunk on disk.


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

	* Version Alpha_25.2

	* file.c (nwos_add_new_revision_of_file): Bug #1765315 - added code 
	to find or create the File class before reading any old file objects.
	That way it will be updated to an updated File object when it is read,
	and it will all be happy when it is re-written to disk.
	* (nwos_update_file_001_object_to_current): Bug #1765315 - added code
	to recalculate the data checksum after the object is updated.  This
	way if the object is rewritten to disk it is all kosher.

	NOTE: changes from 2007-07-31 were NOT included in Alpha_25.2.


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

	* disk_io.c (nwos_initialize_disk_io): add line in byte swap loop
	to swap index element along with the others.
	(nwos_terminate_disk_io): add line in byte swap loop to swap index
	element along with the others.
	(nwos_allocate_new_chunk): added code to compute the chunk index
	into actual disk storage and store it in the chunk_info table.
	* expand_sparse.c (main): changed to allow 0023, 0024 or 0025
	compressed to be read in.
	* objectify_private.h (Chunk_Info): changed 'reserved' to 'index',
	because now it is the mapping into the chunk on the disk.


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

	* Version Alpha_25.1

	* file.c (nwos_update_file_001_object_to_current): changed to NOT
	attempt to create the updated file private class definition when
	updating an old file object.  This causes a problem in the case
	that the object storage is opened read only.
	
	* objectify.c (get_file_001_reference): fixed to handle the case,
	again, where an updated file private class definition hasn't been
	created yet.

	* expand_sparse.c (main): changed to allow 0023 or 0024 compressed
	to be read in.


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

	* Version Alpha_25

	* objectify.c (nwos_write_object_to_disk): Bug #1754741 - fixed by
	ifdef out assert.  It was used before the bit map to verify we weren't
	writing to a block that was already used.  Now we assume the bit map
	is correct and the block can be written over even if it is non-zero.

	* file.c (nwos_find_matching_path_and_file_association): Bug #1763165
	fixed to return false when an error occurs, return value is boolean and
	it was returning ERROR_OCCURRED which is non-zero.

	* objectify.h (VERSION_STRING): moved to configure.ac so it is in
	the same place as the PACKAGE_VERSION.
	* configure.ac (VERSION_STRING): added definition for VERSION_STRING.
	Also changed Package version to "Alpha_25" and version string to "0025"
	because the File class definition changed in the public objects and 
	although the storage header did not change, it could do wacky things if
	the public objects and code did not match up.
	* config.h.in (VERSION_STRING): added undef so configure will define
	it.

	* objectify.c (get_file_001_reference): added a static boolean
	variable 'inside_already' so if it gets called recursively it
	will just return instead of reentering until the stack overflows.


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

	* objectify.c (get_file_001_reference): fixed to handle the case
	where no private File class exists yet and changed to save the
	reference in the loop before reading the next object header.
	(get_file_class_reference): new function to return the latest
	File class reference.
	(nwos_get_object_class): added code to test for older File class
	object and update to newest if it is.


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

	* export_c_structs.c (output_class): changed to properly deal with
	classes that have revisions.
	* attic/add_class_revision.c: new file to create a new revision of
	an existing class, in this case the File class.
	* objectify_private.h (update_file_001_object_to_current): added
	external definition for.
	* class_definition.c (nwos_clone_updated_class_definition): new
	function to clone a class definition that has been updated.
	(nwos_find_or_create_private_class_definition): added code to check
	if public class has been updated and clone the new updated class if
	so.
	(nwos_find_public_class_definition): added code to check for class
	that has been updated and skip over the old one.
	(nwos_find_private_class_definition): added code to check for class
	that has been updated and skip over the old one.
	* file.c (file_size_to_uint64): new inline function to convert File
	object size to uint64.
	(checksum_file, read_file): changed to return uint64 instead of uint32
	and to calculate file length as uint64.
	(nwos_find_matching_file_from_size_md5_sha1): changed to pass in file
	length as uint64.
	(nwos_create_file_without_storing_data, nwos_check_file_checksums)
	(nwos_find_matching_path_and_file_association): changed to deal with 
	file length as uint64 and allow file size up to 1 terabyte.
	(nwos_create_file, nwos_add_new_revision_of_file, nwos_restore_file)
	(nwos_file_is_identical): changed to use uint64 for file length.
	(nwos_update_file_001_object_to_current): new function to convert an
	old file object (32 bit file size) to new file object (64 bits).
	* objectify.c (nwos_ready): new boolean variable to flag when the
	system is ready for normal processing (can call find class definition
	functions, etc.).
	(get_file_001_reference): new function to find the reference for the
	File 001 class.
	(nwos_read_object_from_disk): modified to check to see if object is a
	File_001 class and update it before returning it.


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

	* remove_file.c - new file, this is a hack to remove some files I
	accidentally imported that I didn't want.  I don't recommend using
	this until it is safer.  Right now it could fail and trash your
	archive.


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

	* file.c (nwos_number_of_files_for_path): modified to skip over files
	that have a 'next_version' so it only counts a file with multiple
	revisions once.
	(nwos_file_path_to_path_and_file_association): modified to skip over
	files that have a 'next_version' so it only returns the latest version
	of a file with multiple revisions.
	* export_file.c (export_list): modified to deal with files that have
	more than one revision.

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

	* objectify.h (ObjCreateResult): Added CREATED_NEW_REVISION,
	PATH_NOT_FOUND, and MULTIPLE_FILES values.
	* file.c (nwos_add_new_revision_of_file): new function that creates
	a new revision of a file that is already in the system.
	* import_file.c (main): added "--add-revision" option that calls
	nwos_add_new_revision_of_file to create a new revision of an existing
	file.


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

	* objectify.h (nwos_file_is_identical): added 'match' parameter to
	allow it to ignore the time stamp on the file.
	* file.c (nwos_file_is_identical): added 'match' parameter to allow
	it to ignore the time stamp on the file and included it in 'if'
	statement for testing time stamp.
	* verify_file.c (main): add 'match' parameter in call to
	nwos_file_is_identical so it will ignore the time stamp on the file.

	* verify_file.c (main): added option to allow reading from a
	compressed file instead of default storage (like export_file).


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

	* prep_disk.c (max_blocks_on_device): changed error print statement
	to cast off_t type to int64 so certain compilers won't complain.


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

	* objectify.h (byteswap_uint16): added to swap the bytes in a uint16.
	(byteswap_uint32): added to swap the bytes in a uint32.
	* disk_io.c (nwos_initialize_disk_io): changed to use WORDS_BIGENDIAN
	(generated by ./configure) instead of "__BYTE_ORDER == __LITTLE_ENDIAN"
	to determine endianess, because it is more platform independant.  Also
	changed to use new byteswap_uint16 and byteswap_uint32 functions in
	objectify.h to swap bytes instead of bswap_16 and bswap_32, also for
	platform independence.
	(nwos_terminate_disk_io): same changes as to nwos_initialize_disk_io
	above.
	(nwos_read_block): added initializer for 'i' so that the compiler
	doesn't emit warning about it possibly not being initialized.
	* compress_sparse.c (main): same changes as made in disk_io.c, use
	WORDS_BIGENDIAN and byteswap_uint32.


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

	* configure.ac (AC_C_BIGENDIAN): added so endianess works correctly
	for sha1.c.
	* sha1/Makefile.in (sha1.o): added -DHAVE_CONFIG_H so it will
	include config.h and -I.. so it will get it out of the root
	directory.
	* config.h.in (WORDS_BIGENDIAN): added undef for ./configure to
	fill in.
	* INSTALL: add running ./configure.


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

	* log_disc.c (main): give the 'binder' variable an illegal initial
	value so the compiler on FreeBSD doesn't complain it is
	uninitialized.

	* config.h: renamed to config.h.in.
	* Makefile: renamed to Makefile.in.
	* Makefile.in (CFLAGS): changed -g option to -O3.
	(LIBS): changed to use ./configure generated LIBS instead of 
	"-lrt -lcrypto" because on FreeBSD and OpenBSD it causes an error
	to include -lrt.
	(clean_all): added command to remove configure generated Makefile
	and config.h.  Removed cleaning of attic/convert_c_structs_to_csv
	because it is no longer used.
	* md5/Makefile: renamed to md5/Makefile.in.
	* md5/Makefile.in (CFLAGS): changed -g option to -O3.
	(clean_all): added section to remove configure generated Makefile.
	* sha1/Makefile: renamed to sha1/Makefile.in.
	* sha1/Makefile.in (CFLAGS): changed -g option to -O3.
	(clean_all): added section to remove configure generated Makefile.
	* objectify.h (RELEASE_VERSION): removed, use PACKAGE_VERSION
	generated by ./configure script in config.h.
	* prep_disk.c (agree_no_warranty): changed RELEASE_VERSION to
	PACKAGE_VERSION.


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

	* person.c (nwos_add_birthday): new function to add a birthday
	to a person that doesn't have one (can't change a birthday yet).
	* objectify.h (nwos_add_birthday): add external declaration.
	* computer.c (execute_command): add code to add a person's
	birthday.
	(main): add print statement for adding a birthday.


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

	* prep_disk.c (write_chunks): added code to clear errno before
	writing chunks so it won't be non-zero because of some previous
	call.
	* reference_list.c (nwos_create_reference_list_with_existing_id):
	fix bug where memory allocated for first block was file block
	size and not the actual size of Ref_List_First_Block structure.


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.


