home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 024 / psi110g.zip / MKTL.C < prev    next >
C/C++ Source or Header  |  1994-04-17  |  723b  |  34 lines

  1. /* Create command files for Borland TLIB command. Reads list of
  2.  * object file names from stdin in free format
  3.  *
  4.  * June 1992 P. Karn
  5.  */
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include <ctype.h>
  9. int
  10. main()
  11. {
  12.     int c;
  13.     int prev = 0;
  14.   
  15.     for(;;){
  16.         /* Skip leading white space */
  17.         while(c = getchar(),isspace(c))
  18.             ;
  19.         if(c == EOF)
  20.             break;
  21.         if(prev)
  22.             printf(" &\n");
  23.         /* Print "+token" */
  24.         printf("+%c",c);
  25.         while(c = getchar(),!isspace(c) && c != EOF)
  26.             putchar(c);
  27.         if(c == EOF)
  28.             break;
  29.         prev = 1;
  30.     }
  31.     putchar('\n');  /* Final line is empty */
  32.     return 0;
  33. }
  34.