2011-05-24  Marco Parrone  <marco@marcoparrone.com>

	* mail-to-news.c: Now includes "config.h". Renamed `newsgroups' to
	`header_lines_to_add', added new global variable `infd' for
	changing the input file descriptor.
	(header_add_2, header_add_3, header_add_4): Removed functions.
	(header_add): Now includes the code from (`header_add_2',
	`header_add_3' and `header_add_4'). Now is more generic and allows
	many header lines to be added.
	(write_char): Now replace '\n' with '\r' plus '\n' only if the
	previous character wasn't '\r'.
	(read_char, remove_from): Now use `infd' for input file descriptor.
	(splithts): Now the separator isn't ':' anymore, now it is ' '.
	(to_strip_p): Now handles the case when there are no headers to
	strip.
	(print_help, print_version): New functions.
	(main): Added more complex (but more usual) command line handling.

2011-05-23  Marco Parrone  <marco@marcoparrone.com>

	* mail-to-news.c: Added some documentation for the global
	variables etc... Renamed some variables with more self-explaining
	names.
	(realloc_v): New function.
	(header_name): Now there are no arbitrary limits to the length of
	the header name.
	(splithts): Removed arbitrary limit on the maximum number of
	possible headers to skip.

	* mail-to-news.c: Added global variables: sock (moved from main),
	newsgroup, header_to_add, dotdot, buf, buf1000, buf1000i, prev;
	(read_error, write_error, read_char)
	(write_char, header_content, header_content_2)
	(header_name_start, header_name_start_2, header_name)
	(header_name_end, header_skip_0, header_skip, header_skip_2)
	(header_skip_3, header_add, header_add_2, header_add_3)
	(header_add_4, body_read, body, body_write, body_double)
	(remove_from): New functions (ported from
	`mail-to-news-light.asm').
	(main): Now call `remove_from' instead of `mail_to_news'.

	* mail-to-news-light.c: Renamed file to `mail-to-news.c'.

	* mail-to-news.scm: Removed file.

	* mail-to-news-light.asm: Removed file.

2004-03-18  Marco Parrone  <marco@marcoparrone.com>

	* mail-to-news: Now the `mail-to-news.com' band is used instead of
	`mtn.com'.

	* mail-to-news-light-i.c: New file.

	* mail-to-news-light.asm: New file.

2004-03-15  Marco Parrone  <marco@marcoparrone.com>

	* mail-to-news.scm (mail-to-news): Internal `check-limit' function
	now does not check `limit': now the check is up to the callers.
	Updated callers.  Internal `header-content', `header-name',
	`header-name-end', `header-skip', `body' functions: where there
	was a named let for looping, now a tail-call is used, where there
	was a let, now an argument is added to the lambda.  Update callers
	and self tail-calls.  Now return `'limit-reached' when the limit
	is reached and `'eof-reached-prematurely' when the EOF is reached
	prematurely, instead of signaling the relative errors.  Return
	`'eof-reached' on success.

	(mail-to-news): Added support for multiple messages.

	(entry-point): Internal `debugmsg' function now uses only
	`read-char' and checks only against EOF, instead of using
	`read-char-no-hang' too and checking for #f char too.  Now the
	different `mail-to-news' return values are handled.

2004-03-14  Marco Parrone  <marco@marcoparrone.com>

	* mail-to-news.scm (mail-to-news): Replaced the `big cond' with a
	set of mutually-calling functions.  Implemented message length
	limit.

	(debugmsg): Now is defined into `entry-point' function.  Now
	writes to the *debug* port instead of opening it from the (fu)
	*debug-arg* filename each time.

	(entry-point): Now includes `debugmsg' function.  Pushed out code
	to show usage infos into the relative parsing callback.  Pushed
	out code to show version infos into the relative parsing callback.

	Now the `--debug' (`-d') options accepts a filename.
	Other fixes.
	Other cosmetic changes.

2004-03-13  Marco Parrone  <marco@marcoparrone.com>

	* mail-to-news.scm: Mainly rewrote.
	* mail-to-news: Mainly rewrote.

	* internet-message.scm: Removed file.
	* nntp.scm: Removed file.
	* mbox.scm: Removed file.
	* io.scm: Removed file.
	* log.scm: Removed file.
	* Makefile.am: Removed file.

2004-03-12  Marco Parrone  <marco@marcoparrone.com>

	* nntp.scm (double-dots-in-first-column): In loop2, check only if
	(cdr refs) is null, do not check if refs is null too (initially
	refs contains at least two elements, so that's ok).

2004-03-06  Marco Parrone  <marco@marcoparrone.com>

	* nntp.scm (double-dots-in-first-column): Rewrote to minimize
	strings building.

2004-03-04  Marco Parrone  <marco@marcoparrone.com>

	* log.scm: Re-added file.

	* Makefile.am (pkgdata_DATA): Removed `string-fun.scm', added
	`io.scm', added `log.scm'.

	* io.scm: New file.

	* mail-to-news.scm (get-file-content, make-connected-socket)
	(close-connection): Removed: moved to `io.scm'.

	Now use (mail-to-news io).

	Now does not use (ice-9 rw) anymore.

	Now use (mail-to-news log).

	(usage): Added `--debug' (`-d') option.

	(mail-to-news-command-line-interface): Added support for the
	`--debug' (`-d') option.

	* string-fun.scm: Removed.  The one from original ice-9 one will
	be used instead.

	* internet-message.scm: Use (ice-9 string-fun) instead of
	(mail-to-news string-fun).

	(convert-EOL-mac): Removed (I can not test if this is
	correnct/needed or not - I don't use macs)

	(make-EOL-converter): Removed (it's superfluous now).

	(convert-EOL): Now is an alias for convert-EOL-unix.

	(split-header-and-value): Use substring instead of deprecated
	`make-shared-substring'.

	Cosmetic changes.

	* mbox.scm: Use (ice-9 string-fun) instead of
	(mail-to-news string-fun).

	Cosmetic changes.

	* nntp.scm: Do not use (mail-to-news string-fun) anymore.

	Do not use (mail-to-news internet-message) anymore.

	double-dots-in-first-column): Rewrote, now the splitting of the
	string is done only when really needed.

2004-02-28  Marco Parrone  <marco@marcoparrone.com>

	* mail-to-news.scm (mail-to-news): Now
	`double-dots-in-first-column' is called on the article before
	being posted (`post-article').
	(prepare-message): Removed superfluous checks.
	(version, usage): New variables.
	(mail-to-news-command-line-interface-show-usage)
	(mail-to-news-command-line-interface-show-version): Removed
	functions.
	(mail-to-news-command-line-interface): Adapted to the above
	changes.
	(prepare-message): Removed function.
	(mail-to-news): Now includes the code previously contained in
	`prepare-message'.

	* nntp.scm: Do not use the `internet-message' module anymoer.
	(post-article): Don't do any conversion on the article anymore.
	Cosmetic changes.

2004-02-23  Marco Parrone  <marco@marcoparrone.com>

	* Makefile.am (pkgdata_DATA): Removed `log.scm'.

	* log.scm: Removed (unused now).

	* mail-to-news.scm (mail-to-news-command-line-interface): Added
	`--add-header-lines-from' (`-A') option.  Removed `--log-file'
	(`-l') option.
	(mail-to-news-command-line-interface-show-usage): Likewise.

	* internet-message.scm (split-headers): Do not cut off the last
	newline anymore. Cut off the last item instead.
	(strip-header): Now it's case insensitive.
	(get-header-value): Removed (it was unused).

2004-02-18  Marco Parrone  <marco@marcoparrone.com>

	* internet-message.scm (make-convert-EOL-X): New function.

	* nntp.scm (nntp-post-article): Renamed to post-article.
	(nntp-double-dots-in-first-column): Renamed to
	double-dots-in-first-column.

	* mbox.scm (mbox-from-line-to-x-from-line): Renamed to
	convert-from-line-to-x-from-line.

	* log.scm (get-last-non-space-char-position): Renamed to
	get-last-non-space-char-position.

	* internet-message.scm (internet-message-lf-to-cr-lf): Renamed to
	convert-EOL-unix.
	(convert-EOL-mac): New function.
	(make-EOL-converter): New function.
	(convert-EOL): New function.
	(internet-message-make-date): Renamed to make-date.
	(internet-message-make-message-id): Renamed to make-message-id.
	(internet-message-split-headers): Renamed to split-headers.
	(internet-message-join-headers): Renamed to join-headers.
	(internet-message-repair-multiline-headers): Renamed to
	repair-multiline-headers.
	(internet-message-split-headers-and-values): Renamed to
	split-headers-and-values.
	(join-headers-and-values): Renamed to join-headers-and-values.
	(internet-message-split-header-and-value): Renamed to
	split-header-and-value.
	(internet-message-get-header-value): Renamed to get-header-value.
	(internet-message-split-headers-and-body): Renamed to
	split-headers-and-body.
	(internet-message-strip-header): Renamed to strip-header.
	(internet-message-strip-headers): Renamed to strip-headers.
	(internet-message-strip-headers-2): Renamed to strip-headers-2.

2004-02-14  Marco Parrone  <marco@marcoparrone.com>

	* internet-message.scm (internet-message-lf-to-cr-lf): New function.

	* nntp.scm (nntp-double-dots-in-first-column): Cleaned.

	* Makefile.am (pkgdata_DATA): Added `log.scm'.

	* log.scm: New file.
	(msglog): Renamed to `log-message'.
	(get-last-non-space-char-position): Renamed to
	`log-get-last-non-space-char-position'.

	* internet-message.scm: `(ice-9 format)' and`(ice-9
	rdelim)' now are not used.
	(internet-message-make-message-id): Use number->string instead of
	format.
	(internet-message-repair-multiline-headers): Rewrote for better
	performance (it's cleaner too now).  Lost its second argument.
	(internet-message-split-headers): Adapted to
	`internet-message-repair-multiline-headers' changes (removed
	second bogus argument).

	* mail-to-news.scm: Now uses `(mail-to-news log)'.
	(prepare-message): Removed code and arguments
	specific to "Approved", "Resent-From", "Resent-Sender" and
	"Newsgroups" adding: `header-lines-to-add' is a good general
	replacement, good practice will be pushed by documentation, not
	by code.
	(mail-to-news): Likewise.
	Removed unused `log-port' argument.
	(mail-to-news-command-line-interface): Likewise.
	Added `--help' and `--version' options handling.
	Now `--input-file' and `--log-file' are not required, default
	values are used instead.
	Now does not give the `log-port' argument to `mail-to-news'.
	Added message logging.
	(mail-to-news-command-line-interface-show-usage): New function.
	(mail-to-news-command-line-interface-show-version): New function.
	(get-last-non-space-char-position): Moved to `log.scm'.
	(log-sock): Likewise.
	(msglog): Likewise.


2004-02-05  Marco Parrone  <marco@marcoparrone.com>

	* internet-message.scm (internet-message-strip-header): Now builds
	the list new-headers-and-values consing and reversing at the end,
	instead of appending, for performance matters.

2003-11-28  Marco Parrone  <marco@marcoparrone.com>

	* mail-to-news.scm: Removed superfluous `load's and `:use-module'.

	* internet-message.scm, mbox.scm, nntp.scm: Now uses (mail-to-news
	string-fun) module instead of (ice-9 string-fun).

	* Makefile.am (pkgdata_DATA): Added file `string-fun.scm'.

	* string-fun.scm: New file.

	* internet-message.scm (internet-message-split-header-and-value):
	Now checks if the first character of the header value is a space
	before removing it.
	(internet-message-split-headers): Rewrote
	for increasing speed.
	(internet-message-split-header-and-value): replaced substring
	function call with make-shared-substring function call.
	(internet-message-get-header-value): Fixed.

	* nntp.scm (nntp-double-dots-in-first-column): New function.
	(nntp-post-article): Now calls the
	nntp-double-dots-in-first-column function.

2003-11-27  Marco Parrone  <marco@marcoparrone.com>

	* mail-to-news.scm (get-file-content): speeded up: now loads the
	entire file in the buffer using block I/O.

2003-11-08  Marco Parrone  <marco@marcoparrone.com>

	* Makefile.am (pkgdata_DATA): New variable.
	(EXTRA_DIST): Added pkgdata_DATA content.

	* mbox.scm: New file.
	(mbox-from-line-to-x-from-line): New function (was in the
	mail-to-news.scm file, without the mbox- prefix).

	* mail-to-news.scm: New file (was mail-to-news).
	Now uses (files-formats mbox).
	(from-line-to-x-from-line): Removed (moved to mbox.scm).

	* mail-to-news: Renamed to mail-to-news.scm.

2003-11-07  Marco Parrone  <marco@marcoparrone.com>

	* nntp.scm: New file.
	(nntp-post-article): New function (was in the `mail-to-news' file,
	without the `nntp-' prefix).

	* internet-message.scm: New file.
	(internet-message-make-date, internet-message-make-message-id)
	(internet-message-split-headers, internet-message-join-headers)
	(internet-message-repair-multiline-headers)
	(internet-message-split-headers-and-values)
	(internet-message-join-headers-and-values)
	(internet-message-split-header-and-value)
	(internet-message-join-header-and-value)
	(internet-message-get-header-value)
	(internet-message-split-headers-and-body)
	(internet-message-strip-header, internet-message-strip-headers)
	(internet-message-strip-headers-2): New function (was in the
	`mail-to-news' file, usually with the same name but without the
	`internet-message-' prefix, or however with a similar name).

	* mail-to-news: Now uses (net internet-message).
	Now uses (net nntp).
	(make-message-id-header-value, make-date-header-value)
	(split-headers, join-headers, repair-multiline-headers)
	(split-headers-and-values, join-headers-and-values)
	(split-header-and-value, join-header-and-value)
	(get-header-value)
	(split-headers-and-body, strip-header, strip-headers)
	(strip-headers-2): Removed (moved to internet-message.scm).
	(post-article): Removed (moved to nntp.scm).

2003-11-05  Marco Parrone  <marco@marcoparrone.com>

	* mail-to-news (mail-to-news): Now does not contain command line
	interface code.
	(main): Now is not an alias to mail-to-news, but supplies a
	command line interface to it.
	(mail-to-news-command-line-interface): Function main was renamed
	to mail-to-news-command-line-interface.
	(strip-header): New function.
	(strip-headers): New function.
	(prepare-message): Now calls strip-headers. Now includes
	add-newsgroup. Now includes add-resent-headers. Now includes
	approve-message. Now includes add-header.
	(add-newsgroups): Removed.
	(add-resent-headers): Removed.
	(approve-message): Removed.
	(add-header): Removed.
	(make-header): Removed.
	(get-last-non-space-char-position): Renamed (was
	get-first-non-space-char-position) function and calls to it.
	(strip-headers-2): New function.
	(prepare-message): Now does not call strip-headers, but
	strip-headers-2.
	(split-headers): Now does not remove the #\newline at end of line.
	(join-headers): New function.
	(join-header-and-value): New function.
	(join-headers-and-values): New function.
	(mail-to-news-command-line-interface, mail-to-news)
	(prepare-message): Added header-lines-to-add handling.

2003-10-16  Marco Parrone  <marco@marcoparrone.com>

	* mail-to-news (repair-multiline-headers): Added function.
	(split-headers): Now uses the repair-multiline-headers function.
	(make-header): Renamed function (was make-header-line).
	(from-line-to-x-from-line): New function.
	(prepare-message): Now uses from-line-to-x-from-line function.
	(strip-first-line): Removed function.
	(make-header): Fixed (s/append-string/string-append/).
	(split-headers): Now removes the last (empty) string.
	(repair-multiline-headers): Now re-adds the newlines in multiline
	headers (so they remain multiline headers).

2003-09-09  Marco Parrone  <marco@marcoparrone.com>

	* mail-to-news (make-message-id-header-value): Now uses the uid
	too. Now mtn is appendend instead of m2n.

2003-08-27  Marco Parrone  <marco@marcoparrone.com>

	* Makefile.am: Added.
