/[gentoo-projects]/pax-utils/scanmacho.c
Gentoo

Diff of /pax-utils/scanmacho.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.19 Revision 1.20
1/* 1/*
2 * Copyright 2008 Gentoo Foundation 2 * Copyright 2008 Gentoo Foundation
3 * Distributed under the terms of the GNU General Public License v2 3 * Distributed under the terms of the GNU General Public License v2
4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanmacho.c,v 1.19 2010/12/08 00:54:40 vapier Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanmacho.c,v 1.20 2010/12/08 01:16:01 vapier Exp $
5 * 5 *
6 * based on scanelf by: 6 * based on scanelf by:
7 * Copyright 2003-2007 Ned Ludd - <solar@gentoo.org> 7 * Copyright 2003-2007 Ned Ludd - <solar@gentoo.org>
8 * Copyright 2004-2007 Mike Frysinger - <vapier@gentoo.org> 8 * Copyright 2004-2007 Mike Frysinger - <vapier@gentoo.org>
9 * for Darwin specific fun: 9 * for Darwin specific fun:
10 * 2008-2010 Fabian Groffen - <grobian@gentoo.org> 10 * 2008-2010 Fabian Groffen - <grobian@gentoo.org>
11 */ 11 */
12 12
13static const char *rcsid = "$Id: scanmacho.c,v 1.19 2010/12/08 00:54:40 vapier Exp $"; 13static const char *rcsid = "$Id: scanmacho.c,v 1.20 2010/12/08 01:16:01 vapier Exp $";
14const char argv0[] = "scanmacho"; 14const char argv0[] = "scanmacho";
15 15
16#include "paxinc.h" 16#include "paxinc.h"
17 17
18#define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+') 18#define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+')
495 } 495 }
496 496
497 free(path); 497 free(path);
498} 498}
499 499
500/* usage / invocation handling functions */ /* Free Flags: c d e j k l r s t u w x z C G H I J K L P Q T U W X Y */ 500/* usage / invocation handling functions */ /* Free Flags: c d e j k l r s t u w x z G H I J K L P Q T U W X Y */
501#define PARSE_FLAGS "pRmyAnibSN:gE:M:DO:ZaqvF:f:o:BhV" 501#define PARSE_FLAGS "pRmyAnibSN:gE:M:DO:ZaqvF:f:o:CBhV"
502#define a_argument required_argument 502#define a_argument required_argument
503static struct option const long_opts[] = { 503static struct option const long_opts[] = {
504 {"path", no_argument, NULL, 'p'}, 504 {"path", no_argument, NULL, 'p'},
505 {"recursive", no_argument, NULL, 'R'}, 505 {"recursive", no_argument, NULL, 'R'},
506 {"mount", no_argument, NULL, 'm'}, 506 {"mount", no_argument, NULL, 'm'},
521 {"quiet", no_argument, NULL, 'q'}, 521 {"quiet", no_argument, NULL, 'q'},
522 {"verbose", no_argument, NULL, 'v'}, 522 {"verbose", no_argument, NULL, 'v'},
523 {"format", a_argument, NULL, 'F'}, 523 {"format", a_argument, NULL, 'F'},
524 {"from", a_argument, NULL, 'f'}, 524 {"from", a_argument, NULL, 'f'},
525 {"file", a_argument, NULL, 'o'}, 525 {"file", a_argument, NULL, 'o'},
526 {"nocolor", no_argument, NULL, 'C'},
526 {"nobanner", no_argument, NULL, 'B'}, 527 {"nobanner", no_argument, NULL, 'B'},
527 {"help", no_argument, NULL, 'h'}, 528 {"help", no_argument, NULL, 'h'},
528 {"version", no_argument, NULL, 'V'}, 529 {"version", no_argument, NULL, 'V'},
529 {NULL, no_argument, NULL, 0x0} 530 {NULL, no_argument, NULL, 0x0}
530}; 531};
551 "Only output 'bad' things", 552 "Only output 'bad' things",
552 "Be verbose (can be specified more than once)", 553 "Be verbose (can be specified more than once)",
553 "Use specified format for output", 554 "Use specified format for output",
554 "Read input stream from a filename", 555 "Read input stream from a filename",
555 "Write output stream to a filename", 556 "Write output stream to a filename",
557 "Don't emit color in output",
556 "Don't display the header", 558 "Don't display the header",
557 "Print this help and exit", 559 "Print this help and exit",
558 "Print version and exit", 560 "Print version and exit",
559 NULL 561 NULL
560}; 562};
627 } 629 }
628 case 'Z': show_size = 1; break; 630 case 'Z': show_size = 1; break;
629 case 'g': g_match = 1; break; 631 case 'g': g_match = 1; break;
630 case 'y': scan_symlink = 0; break; 632 case 'y': scan_symlink = 0; break;
631 case 'A': scan_archives = 1; break; 633 case 'A': scan_archives = 1; break;
634 case 'C': color_init(true); break;
632 case 'B': show_banner = 0; break; 635 case 'B': show_banner = 0; break;
633 case 'p': scan_envpath = 1; break; 636 case 'p': scan_envpath = 1; break;
634 case 'R': dir_recurse = 1; break; 637 case 'R': dir_recurse = 1; break;
635 case 'm': dir_crossmount = 0; break; 638 case 'm': dir_crossmount = 0; break;
636 case 'n': show_needed = 1; break; 639 case 'n': show_needed = 1; break;
722int main(int argc, char *argv[]) 725int main(int argc, char *argv[])
723{ 726{
724 int ret; 727 int ret;
725 if (argc < 2) 728 if (argc < 2)
726 usage(EXIT_FAILURE); 729 usage(EXIT_FAILURE);
730 color_init(false);
727 ret = parseargs(argc, argv); 731 ret = parseargs(argc, argv);
728 fclose(stdout); 732 fclose(stdout);
729 return ret; 733 return ret;
730} 734}

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.20