C:/Users/Dennis/src/lang/russell.orig/src/utilities/insnl.c

Go to the documentation of this file.
00001 # include <stdio.h>
00002 
00003 # define LIM1 55
00004 # define LIM2 70
00005 
00006 /* insert newlines into a file */
00007 main()
00008 {   int c;
00009     int column  = 1;
00010 
00011     c = getchar();
00012     while ( c != EOF ) {
00013         if (column <= LIM1) {
00014             putchar(c);
00015             column++;
00016         }
00017         else if (column <= LIM2) {
00018             putchar(c);
00019             if (('a' <= c && c <= 'z') ||
00020                 ('A' <= c && c <= 'Z') ||
00021                 ('0' <= c && c <= '9')) {
00022                     column++;
00023             }
00024             else {
00025                 putchar('\n');
00026                 column = 1;
00027             }
00028         }
00029         else {
00030             putchar(c);
00031             putchar('\n');
00032             column = 1;
00033         }
00034         c = getchar();
00035     }
00036     putchar('\n');
00037 }
00038 
00039 

Generated on Fri Jan 25 10:39:48 2008 for russell by  doxygen 1.5.4