summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--text-utils/display.c14
-rw-r--r--text-utils/hexdump.c4
-rw-r--r--text-utils/hexdump.h10
-rw-r--r--text-utils/parse.c38
4 files changed, 33 insertions, 33 deletions
diff --git a/text-utils/display.c b/text-utils/display.c
index b2ed9753f..79a68bf8f 100644
--- a/text-utils/display.c
+++ b/text-utils/display.c
@@ -190,15 +190,15 @@ void display(void)
while ((bp = get()) != NULL) {
fs = &fshead; savebp = bp; saveaddress = address;
list_for_each(p, fs) {
- fss = list_entry(p, FS, nextfs);
- list_for_each(q, &fss->nextfu) {
- fu = list_entry(q, FU, nextfu);
+ fss = list_entry(p, FS, fslist);
+ list_for_each(q, &fss->fulist) {
+ fu = list_entry(q, FU, fulist);
if (fu->flags&F_IGNORE)
break;
cnt = fu->reps;
while (cnt) {
- list_for_each(r, &fu->nextpr) {
- pr = list_entry(r, PR, nextpr);
+ list_for_each(r, &fu->prlist) {
+ pr = list_entry(r, PR, prlist);
if (eaddress && address >= eaddress &&
!(pr->flags&(F_TEXT|F_BPAD)))
bpad(pr);
@@ -228,8 +228,8 @@ void display(void)
return;
eaddress = address;
}
- list_for_each (p, &endfu->nextpr) {
- pr = list_entry(p, PR, nextpr);
+ list_for_each (p, &endfu->prlist) {
+ pr = list_entry(p, PR, prlist);
switch(pr->flags) {
case F_ADDRESS:
printf(pr->fmt, (int64_t)eaddress);
diff --git a/text-utils/hexdump.c b/text-utils/hexdump.c
index e3c3897ed..d5b9992e0 100644
--- a/text-utils/hexdump.c
+++ b/text-utils/hexdump.c
@@ -72,14 +72,14 @@ int main(int argc, char **argv)
/* figure out the data block size */
blocksize = 0;
list_for_each(p, &fshead) {
- tfs = list_entry(p, FS, nextfs);
+ tfs = list_entry(p, FS, fslist);
if ((tfs->bcnt = block_size(tfs)) > blocksize)
blocksize = tfs->bcnt;
}
/* rewrite the rules, do syntax checking */
list_for_each(p, &fshead)
- rewrite(list_entry(p, FS, nextfs));
+ rewrite(list_entry(p, FS, fslist));
next(argv);
display();
diff --git a/text-utils/hexdump.h b/text-utils/hexdump.h
index c9fc4a009..f81b3bd13 100644
--- a/text-utils/hexdump.h
+++ b/text-utils/hexdump.h
@@ -36,7 +36,7 @@
#include "list.h"
typedef struct _pr {
- struct list_head nextpr; /* next print unit */
+ struct list_head prlist; /* next print unit */
#define F_ADDRESS 0x001 /* print offset */
#define F_BPAD 0x002 /* blank pad */
#define F_C 0x004 /* %_c */
@@ -56,8 +56,8 @@ typedef struct _pr {
} PR;
typedef struct _fu {
- struct list_head nextfu; /* next format unit */
- struct list_head nextpr; /* next print unit */
+ struct list_head fulist; /* next format unit */
+ struct list_head prlist; /* next print unit */
#define F_IGNORE 0x01 /* %_A */
#define F_SETREP 0x02 /* rep count set, not default */
unsigned int flags; /* flag values */
@@ -67,8 +67,8 @@ typedef struct _fu {
} FU;
typedef struct _fs { /* format strings */
- struct list_head nextfs; /* linked list of format strings */
- struct list_head nextfu; /* linked list of format units */
+ struct list_head fslist; /* linked list of format strings */
+ struct list_head fulist; /* linked list of format units */
int bcnt;
} FS;
diff --git a/text-utils/parse.c b/text-utils/parse.c
index a6e577825..08e6123e5 100644
--- a/text-utils/parse.c
+++ b/text-utils/parse.c
@@ -87,9 +87,9 @@ void add(const char *fmt)
/* Start new linked list of format units. */
tfs = xcalloc(1, sizeof(FS));
- INIT_LIST_HEAD(&tfs->nextfs);
- INIT_LIST_HEAD(&tfs->nextfu);
- list_add_tail(&tfs->nextfs, &fshead);
+ INIT_LIST_HEAD(&tfs->fslist);
+ INIT_LIST_HEAD(&tfs->fulist);
+ list_add_tail(&tfs->fslist, &fshead);
/* Take the format string and break it up into format units. */
p = (unsigned char *)fmt;
@@ -102,9 +102,9 @@ void add(const char *fmt)
/* Allocate a new format unit and link it in. */
tfu = xcalloc(1, sizeof(FU));
- INIT_LIST_HEAD(&tfu->nextfu);
- INIT_LIST_HEAD(&tfu->nextpr);
- list_add_tail(&tfu->nextfu, &tfs->nextfu);
+ INIT_LIST_HEAD(&tfu->fulist);
+ INIT_LIST_HEAD(&tfu->prlist);
+ list_add_tail(&tfu->fulist, &tfs->fulist);
tfu->reps = 1;
/* If leading digit, repetition count. */
@@ -166,8 +166,8 @@ int block_size(FS *fs)
int prec;
/* figure out the data block size needed for each format unit */
- list_for_each (p, &fs->nextfu) {
- fu = list_entry(p, FU, nextfu);
+ list_for_each (p, &fs->fulist) {
+ fu = list_entry(p, FU, fulist);
if (fu->bcnt) {
cursize += fu->bcnt * fu->reps;
continue;
@@ -229,8 +229,8 @@ void rewrite(FS *fs)
prec = 0;
- list_for_each (p, &fs->nextfu) {
- fu = list_entry(p, FU, nextfu);
+ list_for_each (p, &fs->fulist) {
+ fu = list_entry(p, FU, fulist);
/*
* Break each format unit into print units; each
* conversion character gets its own.
@@ -239,8 +239,8 @@ void rewrite(FS *fs)
fmtp = fu->fmt;
while (*fmtp) {
pr = xcalloc(1, sizeof(PR));
- INIT_LIST_HEAD(&pr->nextpr);
- list_add_tail(&pr->nextpr, &fu->nextpr);
+ INIT_LIST_HEAD(&pr->prlist);
+ list_add_tail(&pr->prlist, &fu->prlist);
/* Skip preceding text and up to the next % sign. */
p1 = fmtp;
@@ -434,8 +434,8 @@ void rewrite(FS *fs)
* so can adjust rep count later.
*/
if (!fu->bcnt)
- list_for_each(q, &fu->nextpr)
- fu->bcnt += (list_entry(q, PR, nextpr))->bcnt;
+ list_for_each(q, &fu->prlist)
+ fu->bcnt += (list_entry(q, PR, prlist))->bcnt;
}
/*
* If the format string interprets any data at all, and it's
@@ -446,14 +446,14 @@ void rewrite(FS *fs)
* If rep count is greater than 1, no trailing whitespace
* gets output from the last iteration of the format unit.
*/
- list_for_each (p, &fs->nextfu) {
- fu = list_entry(p, FU, nextfu);
- if (list_entry_is_last(&fu->nextfu, &fs->nextfu) && fs->bcnt < blocksize &&
+ list_for_each (p, &fs->fulist) {
+ fu = list_entry(p, FU, fulist);
+ if (list_entry_is_last(&fu->fulist, &fs->fulist) && fs->bcnt < blocksize &&
!(fu->flags&F_SETREP) && fu->bcnt)
fu->reps += (blocksize - fs->bcnt) / fu->bcnt;
if (fu->reps > 1) {
- if (!list_empty(&fu->nextpr)) {
- pr = list_last_entry(&fu->nextpr, PR, nextpr);
+ if (!list_empty(&fu->prlist)) {
+ pr = list_last_entry(&fu->prlist, PR, prlist);
for (p1 = pr->fmt, p2 = NULL; *p1; ++p1)
p2 = isspace(*p1) ? p1 : NULL;
if (p2)