146011Sbostic /*- 246011Sbostic * Copyright (c) 1990 The Regents of the University of California. 346011Sbostic * All rights reserved. 446011Sbostic * 546011Sbostic * This code is derived from software contributed to Berkeley by 646011Sbostic * Hugh Smith at The University of Guelph. 746011Sbostic * 846011Sbostic * %sccs.include.redist.c% 922410Sdist */ 1022410Sdist 1112673Ssam #ifndef lint 1222410Sdist char copyright[] = 1346011Sbostic "@(#) Copyright (c) 1990 The Regents of the University of California.\n\ 1422410Sdist All rights reserved.\n"; 1546011Sbostic #endif /* not lint */ 1622410Sdist 1722410Sdist #ifndef lint 18*46698Sbostic static char sccsid[] = "@(#)ranlib.c 5.6 (Berkeley) 02/26/91"; 1946011Sbostic #endif /* not lint */ 2022410Sdist 21625Sbill #include <sys/types.h> 2246011Sbostic #include <dirent.h> 23625Sbill #include <stdio.h> 24*46698Sbostic #include <stdlib.h> 2546011Sbostic #include <archive.h> 26625Sbill 2746011Sbostic CHDR chdr; 2846011Sbostic u_int options; /* UNUSED -- keep open_archive happy */ 2946011Sbostic char *archive; 30625Sbill 31625Sbill main(argc, argv) 3246011Sbostic int argc; 3346011Sbostic char **argv; 34625Sbill { 3546011Sbostic extern int optind; 3646011Sbostic int ch, eval, tflag; 37625Sbill 3846011Sbostic tflag = 0; 3946011Sbostic while ((ch = getopt(argc, argv, "t")) != EOF) 4046011Sbostic switch(ch) { 4146011Sbostic case 't': 4246011Sbostic tflag = 1; 4346011Sbostic break; 4446011Sbostic case '?': 4546011Sbostic default: 4646011Sbostic usage(); 47625Sbill } 4846011Sbostic argc -= optind; 4946011Sbostic argv += optind; 5019963Smckusick 5146011Sbostic if (!*argv) 5246011Sbostic usage(); 53625Sbill 5446011Sbostic for (eval = 0; archive = *argv++;) 5546011Sbostic eval |= tflag ? touch() : build(); 5646011Sbostic exit(eval); 57625Sbill } 58625Sbill 5946011Sbostic usage() 60625Sbill { 6146011Sbostic (void)fprintf(stderr, "usage: ranlib [-t] archive ...\n"); 6246011Sbostic exit(1); 63625Sbill } 64