]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hexdump: Rename struct _pr to struct hexdump_pr and remove it's typedef
authorOndrej Oprala <ooprala@redhat.com>
Fri, 8 Nov 2013 16:13:10 +0000 (17:13 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 2 Dec 2013 12:44:21 +0000 (13:44 +0100)
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
text-utils/hexdump-conv.c
text-utils/hexdump-display.c
text-utils/hexdump-parse.c
text-utils/hexdump.c
text-utils/hexdump.h

index e17acc4fee922914a42aebb154251741dab5e817..0c4f15fa08df373408febbe53bbd6a602e67ad69 100644 (file)
@@ -38,7 +38,7 @@
 #include "xalloc.h"
 
 void
-conv_c(PR *pr, u_char *p)
+conv_c(struct hexdump_pr *pr, u_char *p)
 {
        char *buf = NULL;
        char const *str;
@@ -85,7 +85,7 @@ strpr:                *pr->cchar = 's';
 }
 
 void
-conv_u(PR *pr, u_char *p)
+conv_u(struct hexdump_pr *pr, u_char *p)
 {
        static const char *list[] = {
                "nul", "soh", "stx", "etx", "eot", "enq", "ack", "bel",
index b6b1f140ddb7b047d5bc8d1fb3e1baa34b89dc6c..21ae62e56538760da50a6ac4b653dd5a43a7693e 100644 (file)
@@ -54,7 +54,7 @@ static off_t address;                 /* address/offset in stream */
 static off_t eaddress;                 /* end address */
 
 static inline void
-print(PR *pr, unsigned char *bp) {
+print(struct hexdump_pr *pr, unsigned char *bp) {
 
        switch(pr->flags) {
        case F_ADDRESS:
@@ -150,7 +150,7 @@ print(PR *pr, unsigned char *bp) {
        }
 }
 
-static void bpad(PR *pr)
+static void bpad(struct hexdump_pr *pr)
 {
        static const char *spec = " -0+#";
        char *p1, *p2;
@@ -180,7 +180,7 @@ void display(void)
        register struct list_head *fs;
        register FS *fss;
        register FU *fu;
-       register PR *pr;
+       register struct hexdump_pr *pr;
        register int cnt;
        register unsigned char *bp;
        off_t saveaddress;
@@ -203,7 +203,7 @@ void display(void)
 
                                while (cnt) {
                                        list_for_each(r, &fu->prlist) {
-                                               pr = list_entry(r, PR, prlist);
+                                               pr = list_entry(r, struct hexdump_pr, prlist);
 
                                                if (eaddress && address >= eaddress
                                                    && !(pr->flags&(F_TEXT|F_BPAD)))
@@ -238,7 +238,7 @@ void display(void)
                        eaddress = address;
                }
                list_for_each (p, &endfu->prlist) {
-                       pr = list_entry(p, PR, prlist);
+                       pr = list_entry(p, struct hexdump_pr, prlist);
                        switch(pr->flags) {
                        case F_ADDRESS:
                                printf(pr->fmt, eaddress);
index 31a82e3ca9dba5fd6773783505d2a83f1c84ca1e..38c45131bcf563960c17462f0fb9e66fae01e659 100644 (file)
@@ -204,7 +204,7 @@ int block_size(FS *fs)
 void rewrite_rules(FS *fs)
 {
        enum { NOTOKAY, USEBCNT, USEPREC } sokay;
-       PR *pr;
+       struct hexdump_pr *pr;
        FU *fu;
        struct list_head *p, *q;
        char *p1, *p2, *fmtp;
@@ -220,7 +220,7 @@ void rewrite_rules(FS *fs)
                nconv = 0;
                fmtp = fu->fmt;
                while (*fmtp) {
-                       pr = xcalloc(1, sizeof(PR));
+                       pr = xcalloc(1, sizeof(struct hexdump_pr));
                        INIT_LIST_HEAD(&pr->prlist);
                        list_add_tail(&pr->prlist, &fu->prlist);
 
@@ -376,7 +376,7 @@ isint:                              cs[2] = '\0';
                        }
 
                        /*
-                        * Copy to PR format string, set conversion character
+                        * Copy to hexdump_pr format string, set conversion character
                         * pointer, update original.
                         */
                        savech = *p2;
@@ -399,7 +399,8 @@ isint:                              cs[2] = '\0';
                 */
                if (!fu->bcnt)
                        list_for_each(q, &fu->prlist)
-                               fu->bcnt += (list_entry(q, PR, prlist))->bcnt;
+                               fu->bcnt
+                                 += (list_entry(q, struct hexdump_pr, prlist))->bcnt;
        }
        /*
         * If the format string interprets any data at all, and it's
@@ -419,7 +420,8 @@ isint:                              cs[2] = '\0';
                                fu->reps += (blocksize - fs->bcnt) / fu->bcnt;
                if (fu->reps > 1) {
                        if (!list_empty(&fu->prlist)) {
-                               pr = list_last_entry(&fu->prlist, PR, prlist);
+                               pr = list_last_entry(&fu->prlist,
+                                 struct hexdump_pr, prlist);
                                for (p1 = pr->fmt, p2 = NULL; *p1; ++p1)
                                        p2 = isspace(*p1) ? p1 : NULL;
                                if (p2)
index 6bccc0262250ed6c68ed7009703ed8431431f6ab..5dfbf1a8093f211e6891f893d16af34b97ef3622 100644 (file)
@@ -208,13 +208,13 @@ void hex_free(void)
        struct list_head *p, *pn, *q, *qn, *r, *rn;
        FS *fs;
        FU *fu;
-       PR *pr;
+       struct hexdump_pr *pr;
        list_for_each_safe(p, pn, &fshead) {
                fs = list_entry(p, FS, fslist);
                list_for_each_safe(q, qn, &fs->fulist) {
                        fu = list_entry(q, FU, fulist);
                        list_for_each_safe(r, rn, &fu->prlist) {
-                               pr = list_entry(r, PR, prlist);
+                               pr = list_entry(r, struct hexdump_pr, prlist);
                                free(pr->fmt);
                                free(pr);
                        }
index 6b15df72e225323b5c64a8417b78dcd89f7098a5..6841cf43c27f0cf6d9fb698d56ef3e224cce36bd 100644 (file)
@@ -35,7 +35,7 @@
 #include "c.h"
 #include "list.h"
 
-typedef struct _pr {
+struct hexdump_pr {
        struct list_head prlist;                /* next print unit */
 #define        F_ADDRESS       0x001           /* print offset */
 #define        F_BPAD          0x002           /* blank pad */
@@ -53,7 +53,7 @@ typedef struct _pr {
        char *cchar;                    /* conversion character */
        char *fmt;                      /* printf format */
        char *nospace;                  /* no whitespace version */
-} PR;
+};
 
 typedef struct _fu {
        struct list_head fulist;                /* next format unit */
@@ -88,7 +88,7 @@ void rewrite_rules(FS *);
 void addfile(char *);
 void display(void);
 void __attribute__((__noreturn__)) usage(FILE *out);
-void conv_c(PR *, u_char *);
-void conv_u(PR *, u_char *);
+void conv_c(struct hexdump_pr *, u_char *);
+void conv_u(struct hexdump_pr *, u_char *);
 int  next(char **);
 int parse_args(int, char **);