home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume4 / portar / main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-11-30  |  844 b   |  46 lines

  1. /*
  2.  *        COPYRIGHT (c) HEWLETT-PACKARD COMPANY, 1984
  3.  *
  4.  *    Permission is granted for unlimited modification, use, and
  5.  *    distribution except that this software may not be sold for
  6.  *    profit.  No warranty is implied or expressed.
  7.  *
  8.  *Author:
  9.  *    Paul Bame, HEWLETT-PACKARD LOGIC SYSTEMS DIVISION - Colorado Springs
  10.  *    { ihnp4!hpfcla | hplabs | harpo!hp-pcd }!hp-lsd!paul
  11.  */
  12. #include <stdio.h>
  13.  
  14. extern    int    arwrite();
  15. extern        arhdwrite();
  16.  
  17. main(argc,argv)
  18. int argc;
  19. char *argv[];
  20. /*
  21.  *    Write the named files (in argv) to stdout in portable ar format.
  22.  */
  23. {
  24.     int i;
  25.  
  26.     if( argc < 2 )
  27.     {
  28.         fprintf(stderr,"Usage: %s file1 [file...]\n",argv[0]);
  29.         exit(1);
  30.     }
  31.  
  32.     /* Write the header */
  33.     arhdwrite(stdout);
  34.  
  35.     /* and the files */
  36.     for( i = 1 ; i < argc ; i++ )
  37.     {
  38.         if( arwrite(argv[i],stdout) < 0 )
  39.         {
  40.             perror(argv[i]);
  41.             exit(1);
  42.         }
  43.     }
  44.     exit(0);
  45. }
  46.