changeset 477:48be71391b9d noffle

[svn] * docs/noffle.1,src/noffle.c: When outputing the entire message base using 'noffle --article all', ditch the previous casual header for each article and switch to the 'rnews' format.
author bears
date Fri, 09 Jul 2004 16:27:20 +0100
parents 29cccddfc307
children 2d5fb05adbc3
files ChangeLog docs/noffle.1 src/noffle.c
diffstat 3 files changed, 27 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Mar 16 11:44:43 2004 +0000
+++ b/ChangeLog	Fri Jul 09 16:27:20 2004 +0100
@@ -1,3 +1,9 @@
+Tue Mar 16 2004 Jim Hague <jim.hague@acm.org>
+
+* docs/noffle.1,src/noffle.c: When outputing the entire message base
+  using 'noffle --article all', ditch the previous casual header for each
+  article and switch to the 'rnews' format.
+
 Tue Mar 16 2004 Jim Hague <jim.hague@acm.org>
 
 * src/authenticate.c: Move includes of grp.h and pwd.h to after the
--- a/docs/noffle.1	Tue Mar 16 11:44:43 2004 +0000
+++ b/docs/noffle.1	Fri Jul 09 16:27:20 2004 +0100
@@ -1,5 +1,5 @@
 .TH noffle 1
-.\" $Id: noffle.1 619 2003-10-31 15:54:59Z godisch $
+.\" $Id: noffle.1 624 2004-07-09 15:27:20Z bears $
 .SH NAME
 noffle \- Usenet package optimized for dialup connections.
 
@@ -136,7 +136,13 @@
 the leading '<' and trailing '>' (quote the argument to avoid shell
 interpretation of '<' and '>').
 .br
-If "all" is given as message Id, all articles are shown. 
+If "all" is given as message Id, all articles are written using the
+.B rnews
+news batch format. In the format, recognised by the UUCP
+.BR rnews (1)
+program, each article is prefixed with a header line. The line
+consists of '#! rnews <len>', where <len> is the size of the
+entire message including headers in bytes.
 
 .TP
 .B \-c, \-\-cancel <message id>
@@ -441,6 +447,7 @@
 .SH SEE ALSO
 
 .BR inews (1),
+.BR rnews (1)
 .BR noffle.conf (5),
 .BR crond (8),
 .BR inetd (8),
--- a/src/noffle.c	Tue Mar 16 11:44:43 2004 +0000
+++ b/src/noffle.c	Fri Jul 09 16:27:20 2004 +0100
@@ -10,7 +10,7 @@
   received for some seconds (to allow multiple clients connect at the same
   time).
 
-  $Id: noffle.c 621 2003-11-29 23:53:31Z bears $
+  $Id: noffle.c 624 2004-07-09 15:27:20Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -75,12 +75,17 @@
         else
             do
             {
-                printf( "From %s %s\n"
-                        "%s\n"
-                        "%s\n",
-                        Db_from( id ), Db_date( id ),
-                        Db_header( id ),
-                        Db_body( id ) );
+		/*
+		 * Output articles in rnews format. The number after
+		 * the rnews header is the length of the article in bytes,
+		 * counting line endings as '\n'.
+		 */
+		const char *header = Db_header( id );
+		const char *body = Db_body( id );
+
+		printf( "#! rnews %d\n%s\n%s\n",
+			strlen(header) + strlen(body) + 2,
+			header, body);
 		res = TRUE;
             }
             while ( Db_next( &id ) );