From b4767da586e1fd09b0aabb694dd58dd3bba20694 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 30 Jan 1998 19:17:25 +0000 Subject: Modified output of @Example style in MsWord output routine so it would be one paragraph with manual line breaks rather than multiple paragraphs.. --- doc/tools/pdl2texi/base.h | 4 ++-- doc/tools/pdl2texi/main.c | 36 ++++++++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 4 deletions(-) (limited to 'doc/tools') diff --git a/doc/tools/pdl2texi/base.h b/doc/tools/pdl2texi/base.h index 725342950f..12d481b3c7 100644 --- a/doc/tools/pdl2texi/base.h +++ b/doc/tools/pdl2texi/base.h @@ -22,8 +22,8 @@ * the program increase significantly. */ -#define BUFFER_SIZE (2 * 1024) -#define PARAGRAPH_SIZE (2 * 1024) +#define BUFFER_SIZE (10 * 1024) +#define PARAGRAPH_SIZE (8 * 1024) #define NUMBER_ELEMENTS( _x ) (sizeof(_x) / sizeof _x[0]) diff --git a/doc/tools/pdl2texi/main.c b/doc/tools/pdl2texi/main.c index 41c161c7df..16ef41197e 100644 --- a/doc/tools/pdl2texi/main.c +++ b/doc/tools/pdl2texi/main.c @@ -564,7 +564,7 @@ void exit_application( fprintf( stderr, "*** Error encountered on line %d ***\n", CurrentLine ); */ fclose( OutFile ); - exit( status ); + exit( 1 ); } /************************************************************************* @@ -2778,6 +2778,7 @@ void FormatToWord( void ) Line_Control *new_line; char Buffer[ PARAGRAPH_SIZE ]; int i; + int length; char ChapterTitle[ PARAGRAPH_SIZE ]; char InfoFile[ PARAGRAPH_SIZE ]; char *p; @@ -2919,16 +2920,47 @@ void FormatToWord( void ) case SYNCHRONIZATION: sprintf( Buffer, "@Subheading = %s\n", line->Contents ); strcpy( line->Contents, Buffer ); + line = (Line_Control *) line->Node.next; /* now take care of the raw text which is here */ - line = (Line_Control *) line->Node.next; +#if 0 while ( !line->keyword ) { sprintf( Buffer, "@Example = %s\n", line->Contents ); strcpy( line->Contents, Buffer ); line = (Line_Control *) line->Node.next; } + /* at this point line points to the next keyword */ +#endif + + /* now take care of the raw text which is here */ + + new_line = AllocateLine(); + _Chain_Insert( line->Node.previous, &new_line->Node ); + strcpy( new_line->Contents, "@Example = " ); + + do { + if ( strlen( line->Contents ) ) { + new_line->keyword = line->keyword; + new_line->format = line->format; + length = strlen(new_line->Contents); + if ( (length + strlen(line->Contents) + 12) > PARAGRAPH_SIZE ) { + fprintf( stderr, "Output line too long at %d\n", line->number ); + exit_application( 1 ); + } + + strcat( new_line->Contents, line->Contents ); + strcat( new_line->Contents, "<@ManualCR>" ); + line = DeleteLine( line ); + } else { + line = (Line_Control *) line->Node.next; + new_line = AllocateLine(); + _Chain_Insert( line->Node.previous, &new_line->Node ); + strcpy( new_line->Contents, "@Example = " ); + } + } while ( !line->keyword ); + /* at this point line points to the next keyword */ break; } -- cgit v1.2.3