]> diplodocus.org Git - nmh/commitdiff
rename %(units) to %(kilo)
authorPaul Fox <pgf@foxharp.boston.ma.us>
Tue, 13 May 2014 13:43:43 +0000 (09:43 -0400)
committerPaul Fox <pgf@foxharp.boston.ma.us>
Wed, 14 May 2014 13:26:58 +0000 (09:26 -0400)
per discussion here:
  http://lists.nongnu.org/archive/html/nmh-workers/2014-05/msg00092.html

etc/mhshow.marker
h/fmt_compile.h
man/mh-format.man
sbr/fmt_compile.c
sbr/fmt_scan.c
uip/fmtdump.c
uip/mhshowsbr.c

index 6e324b1..1fbf109 100644 (file)
@@ -4,4 +4,4 @@
 %;
 [ part %{part} - %{content-type} - %<{description}\
 %{description}%?{cdispo-filename}%{cdispo-filename}%|%{ctype-name}%>  \
 %;
 [ part %{part} - %{content-type} - %<{description}\
 %{description}%?{cdispo-filename}%{cdispo-filename}%|%{ctype-name}%>  \
-%(units(size))B %<(unseen)\(suppressed\)%> ]
+%(kilo(size))B %<(unseen)\(suppressed\)%> ]
index 08eb8d6..bfe4720 100644 (file)
@@ -44,7 +44,7 @@
 #define FT_LS_WEEKDAY  35      /* set "str" to long tws weekday            */
 #define FT_LS_822DATE  36      /* set "str" to 822 date str                */
 #define FT_LS_PRETTY   37      /* set "str" to pretty (?) date str         */
 #define FT_LS_WEEKDAY  35      /* set "str" to long tws weekday            */
 #define FT_LS_822DATE  36      /* set "str" to 822 date str                */
 #define FT_LS_PRETTY   37      /* set "str" to pretty (?) date str         */
-#define FT_LS_UNITS    38      /* set "str" to "<value>[KMGT]"             */
+#define FT_LS_KILO     38      /* set "str" to "<value>[KMGT]"             */
 #define FT_LV_SEC      39      /* set "value" to tws second                */
 #define FT_LV_MIN      40      /* set "value" to tws minute                */
 #define FT_LV_HOUR     41      /* set "value" to tws hour                  */
 #define FT_LV_SEC      39      /* set "value" to tws second                */
 #define FT_LV_MIN      40      /* set "value" to tws minute                */
 #define FT_LV_HOUR     41      /* set "value" to tws hour                  */
index 4dfa263..82128e8 100644 (file)
@@ -290,7 +290,7 @@ decode      expr    string  decode \fIstr\fR as RFC 2047 (MIME-encoded)
                        component
 unquote        expr    string  remove RFC 2822 quotes from \fIstr\fR
 trim   expr            trim trailing whitespace from \fIstr\fR
                        component
 unquote        expr    string  remove RFC 2822 quotes from \fIstr\fR
 trim   expr            trim trailing whitespace from \fIstr\fR
-units  expr    string  convert number to SI units ("15.1K")
+kilo   expr    string  express in SI units: 15.9K, 2.3M, etc.
 putstr expr            print \fIstr\fR
 putstrf        expr            print \fIstr\fR in a fixed width
 putnum expr            print \fInum\fR
 putstr expr            print \fIstr\fR
 putstrf        expr            print \fIstr\fR in a fixed width
 putnum expr            print \fInum\fR
index 200d738..dbd8663 100644 (file)
@@ -159,7 +159,7 @@ static struct ftable functable[] = {
      { "decodecomp", TF_COMP,  FT_LS_DECODECOMP, 0,            TFL_PUTS },
      { "decode",     TF_EXPR,  FT_LS_DECODE,   0,              TFL_PUTS },
      { "trim",       TF_EXPR,  FT_LS_TRIM,     0,              0 },
      { "decodecomp", TF_COMP,  FT_LS_DECODECOMP, 0,            TFL_PUTS },
      { "decode",     TF_EXPR,  FT_LS_DECODE,   0,              TFL_PUTS },
      { "trim",       TF_EXPR,  FT_LS_TRIM,     0,              0 },
-     { "units",      TF_EXPR,  FT_LS_UNITS,    0,              TFL_PUTS  },
+     { "kilo",       TF_EXPR,  FT_LS_KILO,     0,              TFL_PUTS },
      { "compval",    TF_COMP,  FT_LV_COMP,     0,              TFL_PUTN },
      { "compflag",   TF_COMP,  FT_LV_COMPFLAG, 0,              TFL_PUTN },
      { "num",        TF_NUM,   FT_LV_LIT,      0,              TFL_PUTN },
      { "compval",    TF_COMP,  FT_LV_COMP,     0,              TFL_PUTN },
      { "compflag",   TF_COMP,  FT_LV_COMPFLAG, 0,              TFL_PUTN },
      { "num",        TF_NUM,   FT_LV_LIT,      0,              TFL_PUTN },
index c8cdece..2042051 100644 (file)
@@ -490,7 +490,7 @@ fmt_scan (struct format *format, char *scanl, size_t max, int width, int *dat,
                    cp += n;
            }
            break;
                    cp += n;
            }
            break;
-       case FT_LS_UNITS:
+       case FT_LS_KILO:
            {
                char *unitcp;
                unsigned int whole, tenths;
            {
                char *unitcp;
                unsigned int whole, tenths;
index 7ee5d37..c8204f6 100644 (file)
@@ -371,7 +371,7 @@ f_typestr(int t)
        case FT_LV_DIVIDE_L: return("LV_DIVIDE_L");
        case FT_LV_MODULO_L: return("LV_MODULO_L");
        case FT_LV_CHAR_LEFT: return("LV_CHAR_LEFT");
        case FT_LV_DIVIDE_L: return("LV_DIVIDE_L");
        case FT_LV_MODULO_L: return("LV_MODULO_L");
        case FT_LV_CHAR_LEFT: return("LV_CHAR_LEFT");
-       case FT_LS_UNITS: return("LS_UNITS");
+       case FT_LS_KILO: return("LS_KILO");
        case FT_LS_MONTH: return("LS_MONTH");
        case FT_LS_LMONTH: return("LS_LMONTH");
        case FT_LS_ZONE: return("LS_ZONE");
        case FT_LS_MONTH: return("LS_MONTH");
        case FT_LS_LMONTH: return("LS_LMONTH");
        case FT_LS_ZONE: return("LS_ZONE");
index 042ca7c..34c1911 100644 (file)
@@ -1224,7 +1224,7 @@ convert_content_charset (CT ct, char **file) {
                       "%<{description}%{description}" \
                         "%?{cdispo-filename}%{cdispo-filename}" \
                         "%|%{ctype-name}%>  " \
                       "%<{description}%{description}" \
                         "%?{cdispo-filename}%{cdispo-filename}" \
                         "%|%{ctype-name}%>  " \
-                      "%(units(size))B %<(unseen)\\(suppressed\\)%> ]"
+                      "%(kilo(size))B %<(unseen)\\(suppressed\\)%> ]"
 
 static struct format *
 compile_marker(char *markerform)
 
 static struct format *
 compile_marker(char *markerform)