Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.development.apps > #416
| From | Josef Moellers <josef.moellers@ts.fujitsu.com> |
|---|---|
| Newsgroups | comp.os.linux.development.apps |
| Subject | Display chunks of data |
| Date | 2012-02-07 11:54 +0100 |
| Organization | Fujitsu Technology Solutions |
| Message-ID | <jgqvtu$ere$1@nntp.ts.fujitsu.com> (permalink) |
Hi, I have various chunks of data containing various structures, to be precise: SCSI LOG pages, which I want to display. Most are easy, they are structured consisting of tags followed by lengths followed by single scalar items, mostly counters. However, some are more structured (e.g. "Protocol-Specific Port log pages" and "Background Scan Results log pages") and I'm looking for some generic way to display these using a single function and some specification how to interpret the raw data. I was thinking in the ways of mixing plain output with directives that pick up bits and pieces, sort-of a mixture of printf-style formats and Perl-style (un)pack directives. Rather than re-inventing the wheel, maybe someone has already done this or has a lead into the right direction. At present, I have a table specifying the page and the parameter code followed by the name of the field and a directive like "4u" causing 4 bytes to be dispalyed as an unsigned integer. More complex items are specified using "S<n>", causing "special function <n>" to be called. This is ugly and also inflexible because some pages/parameters differ between vendors (I already have a small database containing vendor "quirks", where I could add strings for specific page/parameters). Any ideas? Thanks in advanve, Josef -- These are my personal views and not those of Fujitsu Technology Solutions! Josef Möllers (Pinguinpfleger bei FTS) If failure had no penalty success would not be a prize (T. Pratchett) Company Details: http://de.ts.fujitsu.com/imprint.html
Back to comp.os.linux.development.apps | Previous | Next — Next in thread | Find similar
Display chunks of data Josef Moellers <josef.moellers@ts.fujitsu.com> - 2012-02-07 11:54 +0100
Re: Display chunks of data Jasen Betts <jasen@xnet.co.nz> - 2012-02-08 10:28 +0000
Re: Display chunks of data Josef Moellers <josef.moellers@ts.fujitsu.com> - 2012-02-09 13:48 +0100
csiph-web