comparison src/noffle.c @ 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 e63a3bc27a75
children a04c52f87b6e
comparison
equal deleted inserted replaced
476:29cccddfc307 477:48be71391b9d
8 not as server. If noffle runs as server, locking is performed while 8 not as server. If noffle runs as server, locking is performed while
9 executing NNTP commands, but temporarily released if no new command is 9 executing NNTP commands, but temporarily released if no new command is
10 received for some seconds (to allow multiple clients connect at the same 10 received for some seconds (to allow multiple clients connect at the same
11 time). 11 time).
12 12
13 $Id: noffle.c 621 2003-11-29 23:53:31Z bears $ 13 $Id: noffle.c 624 2004-07-09 15:27:20Z bears $
14 */ 14 */
15 15
16 #if HAVE_CONFIG_H 16 #if HAVE_CONFIG_H
17 #include <config.h> 17 #include <config.h>
18 #endif 18 #endif
73 if ( ! Db_first( &id ) ) 73 if ( ! Db_first( &id ) )
74 fprintf( stderr, "Database empty.\n" ); 74 fprintf( stderr, "Database empty.\n" );
75 else 75 else
76 do 76 do
77 { 77 {
78 printf( "From %s %s\n" 78 /*
79 "%s\n" 79 * Output articles in rnews format. The number after
80 "%s\n", 80 * the rnews header is the length of the article in bytes,
81 Db_from( id ), Db_date( id ), 81 * counting line endings as '\n'.
82 Db_header( id ), 82 */
83 Db_body( id ) ); 83 const char *header = Db_header( id );
84 const char *body = Db_body( id );
85
86 printf( "#! rnews %d\n%s\n%s\n",
87 strlen(header) + strlen(body) + 2,
88 header, body);
84 res = TRUE; 89 res = TRUE;
85 } 90 }
86 while ( Db_next( &id ) ); 91 while ( Db_next( &id ) );
87 } 92 }
88 else 93 else