ref: 7d9ec5573f3348f6d9c26c5eb6945f880d1488f5
parent: 4ec73213a7ed78026a99ce4d4890529340b84839
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri Nov 24 17:21:43 EST 2017
[nm] Use better names for testing functions These more generic functions are better because they can be used as interfaces for a multi binary format support.
--- a/nm/main.c
+++ b/nm/main.c
@@ -21,7 +21,7 @@
int uflag;
static int
-myrofile(char *fname, FILE *fp)
+object(char *fname, FILE *fp)
{
char magic[MYROMAGIC_SIZ];
fpos_t pos;
@@ -38,7 +38,7 @@
}
static int
-arfile(char *fname, FILE *fp)
+archive(char *fname, FILE *fp)
{
char magic[ARMAGIC_SIZ];
fpos_t pos;
@@ -128,7 +128,7 @@
if (hdr.size & 1)
++pos;
- if (myrofile(fname, fp)) {
+ if (object(fname, fp)) {
nm(fname, hdr.name, fp);
} else {
fprintf(stderr,
@@ -147,9 +147,9 @@
if ((fp = fopen(fname, "rb")) == NULL)
goto file_error;
- if (myrofile(fname, fp))
+ if (object(fname, fp))
nm(fname, fname, fp);
- else if (arfile(fname, fp))
+ else if (archive(fname, fp))
ar(fname, fp);
else
fprintf(stderr, "nm: %s: File format not recognized", fname);