| 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/scanelf.c,v 1.17 2005/04/02 00:11:01 vapier Exp $ |
5 | * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.18 2005/04/02 03:25:38 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 |
| … | |
… | |
| 31 | #include <dirent.h> |
31 | #include <dirent.h> |
| 32 | #include <getopt.h> |
32 | #include <getopt.h> |
| 33 | |
33 | |
| 34 | #include "paxelf.h" |
34 | #include "paxelf.h" |
| 35 | |
35 | |
| 36 | static const char *rcsid = "$Id: scanelf.c,v 1.17 2005/04/02 00:11:01 vapier Exp $"; |
36 | static const char *rcsid = "$Id: scanelf.c,v 1.18 2005/04/02 03:25:38 vapier Exp $"; |
| 37 | |
37 | |
| 38 | |
38 | |
| 39 | /* helper functions for showing errors */ |
39 | /* helper functions for showing errors */ |
| 40 | #define argv0 "scanelf\0" /*((*argv != NULL) ? argv[0] : __FILE__ "\b\b")*/ |
40 | #define argv0 "scanelf" /*((*argv != NULL) ? argv[0] : __FILE__ "\b\b")*/ |
| 41 | #define warn(fmt, args...) \ |
41 | #define warn(fmt, args...) \ |
| 42 | fprintf(stderr, "%s: " fmt "\n", argv0, ## args) |
42 | fprintf(stderr, "%s: " fmt "\n", argv0, ## args) |
| 43 | #define warnf(fmt, args...) warn("%s(): " fmt, __FUNCTION__, ## args) |
43 | #define warnf(fmt, args...) warn("%s(): " fmt, __FUNCTION__, ## args) |
| 44 | #define err(fmt, args...) \ |
44 | #define err(fmt, args...) \ |
| 45 | do { \ |
45 | do { \ |