Re: Suggested dual human/binary interface for proc/devfs

From: George Bonser (grep@shorelink.com)
Date: Tue Apr 11 2000 - 03:15:59 EST


On Tue, 11 Apr 2000, Ed Carp wrote:

> Uh, I would've thought that would've been intuitively obvious ;)
>
> device=eth0;ip_address=192.168.201.116,netmask=255.255.255.0
> device=eth1;ip_address=192.168.201.117,netmask=255.255.255.0

So you have made it more difficult.

I can not understand what makes yours easier. Look at it a different way:

device
eth0;ip_address=192.168.201.116,netmask=255.255.255.0
eth1;ip_address=192.168.201.117,netmask=255.255.255.0

Now you have exactly the same thing as I wrote only:

you have a newline instead of a { after device
you a , instead of a ;(or newline) between attribute/data pairs
you use ;...<newline> instead of {} between groups

AS a matter of fact, the device= is redundant. Since it appears in every
line it can be assumed and therefore eliminated. The filename could be
device. It is no "easier" to parse.

The problem is that you are not thinking about scaling down several
levels.

Imagine you are doing a .dump file for /proc/sys/net that outputs
EVERYTHING below it in the tree. How do you present the output so it is
easy to parse? Think about arrays.

As for code that already parses this format, think about any util that
operates on bind or gated configuration files.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:15 EST