1 | /* |
1 | /* |
2 | * Copyright 2003 Ned Ludd <solar@gentoo.org> |
2 | * Copyright 2003 Ned Ludd <solar@gentoo.org> |
3 | * Copyright 1999-2005 Gentoo Foundation |
3 | * Copyright 1999-2005 Gentoo Foundation |
4 | * Distributed under the terms of the GNU General Public License v2 |
4 | * Distributed under the terms of the GNU General Public License v2 |
5 | * $Header: /var/cvsroot/gentoo-projects/pax-utils/Attic/scanelf.c,v 1.35 2005/04/14 00:17:30 solar Exp $ |
5 | * $Header: /var/cvsroot/gentoo-projects/pax-utils/Attic/scanelf.c,v 1.36 2005/04/15 22:02:03 vapier Exp $ |
6 | * |
6 | * |
7 | ******************************************************************** |
7 | ******************************************************************** |
8 | * This program is free software; you can redistribute it and/or |
8 | * This program is free software; you can redistribute it and/or |
9 | * modify it under the terms of the GNU General Public License as |
9 | * modify it under the terms of the GNU General Public License as |
10 | * published by the Free Software Foundation; either version 2 of the |
10 | * published by the Free Software Foundation; either version 2 of the |
… | |
… | |
33 | #include <getopt.h> |
33 | #include <getopt.h> |
34 | #include <assert.h> |
34 | #include <assert.h> |
35 | |
35 | |
36 | #include "paxelf.h" |
36 | #include "paxelf.h" |
37 | |
37 | |
38 | static const char *rcsid = "$Id: scanelf.c,v 1.35 2005/04/14 00:17:30 solar Exp $"; |
38 | static const char *rcsid = "$Id: scanelf.c,v 1.36 2005/04/15 22:02:03 vapier Exp $"; |
39 | |
39 | #define argv0 "scanelf" |
40 | |
|
|
41 | /* helper functions for showing errors */ |
|
|
42 | #define argv0 "scanelf" /*((*argv != NULL) ? argv[0] : __FILE__ "\b\b")*/ |
|
|
43 | #define warn(fmt, args...) \ |
|
|
44 | fprintf(stderr, "%s: " fmt "\n", argv0, ## args) |
|
|
45 | #define warnf(fmt, args...) warn("%s(): " fmt, __FUNCTION__, ## args) |
|
|
46 | #define err(fmt, args...) \ |
|
|
47 | do { \ |
|
|
48 | warn(fmt, ## args); \ |
|
|
49 | exit(EXIT_FAILURE); \ |
|
|
50 | } while (0) |
|
|
51 | |
40 | |
52 | |
41 | |
53 | |
42 | |
54 | /* prototypes */ |
43 | /* prototypes */ |
55 | static void scanelf_file(const char *filename); |
44 | static void scanelf_file(const char *filename); |