tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: humanize_number(3) for dd(1) summary?



> Done. The option is NO_MSGFMT.
> 
> Total binary size:
> 
> new dd: 29920
> new dd, with SMALLPROG: 24864
> old dd: 26677
> old dd, with SMALLPROG: 22028
 :
> @@ -105,6 +108,7 @@ void
>  jcl(char **argv)
>  {
>       struct arg *ap, tmp;
> +     //struct dd_msgfmt *fmt;
>       char *oper, *arg;
>  
>       in.dbsz = out.dbsz = 512;

Leftover?

> --- misc.c    5 Oct 2007 07:23:09 -0000       1.21
> +++ misc.c    2 Nov 2011 22:21:55 -0000
 :
> +static void
> +posix_summary(void)
> +{
> +     char buf[100];
> +
>       /* Use snprintf(3) so that we don't reenter stdio(3). */
> -     (void)snprintf(buf, sizeof(buf),
> -         "%llu+%llu records in\n%llu+%llu records out\n",
> -         (unsigned long long)st.in_full,  (unsigned long long)st.in_part,
> -         (unsigned long long)st.out_full, (unsigned long long)st.out_part);
> +     (void)dd_snprintf(buf, sizeof(buf),
> +         "%I+%i records in\n%O+%o records out\n");
>       (void)write(STDERR_FILENO, buf, strlen(buf));
 :
> +static int
> +dd_snprintf(char *sbuf, size_t len, const char *fmt)
> +{
 :

Can't dd_snprintf() be also optional if it occupies ~2.5KiB?

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index