cvs commit: src/usr.bin/ipcs ipcs.c

John-Mark Gurney gurney_j at resnet.uoregon.edu
Tue Mar 8 17:05:14 GMT 2005


Giorgos Keramidas wrote this message on Tue, Mar 08, 2005 at 15:20 +0200:
> On 2005-03-08 13:14, Giorgos Keramidas <keramida at freebsd.org> wrote:
> > keramida    2005-03-08 13:14:46 UTC
> >
> >   FreeBSD src repository (doc committer)
> >
> >   Modified files:
> >     usr.bin/ipcs         ipcs.c
> >   Log:
> >   Use 12 columns for (int) values, 20 columns for (long) and align
> >   headers properly (right justified for numbers, left justified for
> >   everything else).
> >
> >   This fixes the alignment of the fields on i386, sparc64 and amd64
> >   today but does not dynamically assign column widths or bear in mind
> >   that some of the values may be 64-bit in the future.
> >
> >   Reviewed by:    alfred
> >
> >   Revision  Changes    Path
> >   1.26      +50 -47    src/usr.bin/ipcs/ipcs.c
> 
> If anyone has a good idea for making the columns widths dynamically
> adjustable, please do so :-)

Yes, you can use a * instead of hard coding the widths, and then provide
an integer on the printf line for the width... so:
int foo, bar;
int foowidth, barwidth;

foowidth = barwidth = 8;
foo = 0xa9201;
bar = 0xab29023;
printf("foo: %*d,\tbar: %*d\n", foowidth, foo, barwidth, bar);

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the cvs-src mailing list