Re: On portable C programming

2009-01-10 Thread Jerry Feldman
yes. I may have used some of your stuff at Digital or HP. On 01/09/2009 10:52 AM, Jim Kuzdrall wrote: Yes, it has been quite a problem over the years. I have been designing and programming computers since 1960, mostly at the ALU and binary data level, where format is critical. The

Re: On portable C programming

2009-01-09 Thread Jerry Feldman
On 01/08/2009 08:20 AM, Jim Kuzdrall wrote: On Thursday 08 January 2009 00:06, Ben Scott wrote: On Wed, Jan 7, 2009 at 11:31 PM, virgins...@vfemail.net wrote: So what's the recommended way to do this? I dunno that there really is any really good way. Once created,

Re: On portable C programming

2009-01-09 Thread Jim Kuzdrall
On Friday 09 January 2009 07:47, Jerry Feldman wrote: There are actually systems that do this such as ASN 1 == *X.680. Essentially, the way it works is that everything transmitted is in TLD (type, length data) format. An integer, for instance would have a type code (one for 16-bit, 1 for

Re: On portable C programming (was: libraw1394 struct layouts...)

2009-01-09 Thread VirginSnow
From: Jim Kuzdrall gnh...@intrel.com Date: Thu, 8 Jan 2009 12:33:33 -0500 My outline over-complicated the solution - no pointer array is needed. If the addresses of the structs are be obtained from the kernel while it is running, the data can be sent to or taken from them to an

Re: On portable C programming (was: libraw1394 struct layouts...)

2009-01-09 Thread Ben Scott
On Fri, Jan 9, 2009 at 11:35 AM, virgins...@vfemail.net wrote: I have to admit I don't understand how this is supposed to work. You haven't posted any URLs or project names for me to Google. :) Or even source code snippets. Posting code to this list is allowed, if that's what Jim Kuzdrall

Re: On portable C programming (was: libraw1394 struct layouts...)

2009-01-08 Thread Jim Kuzdrall
On Thursday 08 January 2009 00:06, Ben Scott wrote: On Wed, Jan 7, 2009 at 11:31 PM, virgins...@vfemail.net wrote: So what's the recommended way to do this? I dunno that there really is any really good way. There is a solution to the problem, I believe, if the structs are data

Re: On portable C programming (was: libraw1394 struct layouts...)

2009-01-08 Thread Thomas Charron
On Thu, Jan 8, 2009 at 12:06 AM, Ben Scott dragonh...@gmail.com wrote: On Wed, Jan 7, 2009 at 11:31 PM, virgins...@vfemail.net wrote: So what's the recommended way to do this? I dunno that there really is any really good way. int32_t and int64_t are your friends. :-D One way might be to

Re: On portable C programming (was: libraw1394 struct layouts...)

2009-01-08 Thread VirginSnow
From: Jim Kuzdrall gnh...@intrel.com Organization: Intrel Date: Thu, 8 Jan 2009 08:20:12 -0500 On Thursday 08 January 2009 00:06, Ben Scott wrote: On Wed, Jan 7, 2009 at 11:31 PM, virgins...@vfemail.net wrote: So what's the recommended way to do this? I dunno that there really is

Re: On portable C programming (was: libraw1394 struct layouts...)

2009-01-08 Thread Tom Buskey
On Thu, Jan 8, 2009 at 11:25 AM, virgins...@vfemail.net wrote: From: Jim Kuzdrall gnh...@intrel.com Organization: Intrel Date: Thu, 8 Jan 2009 08:20:12 -0500 On Thursday 08 January 2009 00:06, Ben Scott wrote: On Wed, Jan 7, 2009 at 11:31 PM, virgins...@vfemail.net wrote: So

Re: On portable C programming (was: libraw1394 struct layouts...)

2009-01-08 Thread Kevin D. Clark
Ben Scott writes: On Wed, Jan 7, 2009 at 11:31 PM, virgins...@vfemail.net wrote: One way might be to expose a function/method for accessing each structure member. That's probably the only truly portable way, but it's cumbersome as hell. Yeah, it is cumbersome. Sometimes programming

Re: On portable C programming (was: libraw1394 struct layouts...)

2009-01-08 Thread Jim Kuzdrall
On Thursday 08 January 2009 11:25, virgins...@vfemail.net wrote: While this could work for userland code, you might run into trouble in kernel code. How would you access the struct library from the kernel? And (more importantly!) how would you convince the kernel developers to adopt such a

Re: On portable C programming (was: libraw1394 struct layouts...)

2009-01-08 Thread Ben Scott
On Thu, Jan 8, 2009 at 12:11 PM, Kevin D. Clark kevin_d_cl...@comcast.net wrote: Ben Scott writes: On Wed, Jan 7, 2009 at 11:31 PM, virgins...@vfemail.net wrote: ... function/method for accessing each structure member ... ... only truly portable way, but it's cumbersome ... Yeah, it is

Re: On portable C programming (was: libraw1394 struct layouts...)

2009-01-08 Thread Ben Scott
On Thu, Jan 8, 2009 at 7:41 AM, Jerry Feldman g...@blu.org wrote: On 01/07/2009 04:10 PM, Ben Scott wrote: The C standard provides no guarantees about how struct's will be laid out in memory. The compiler can do (and often does) whatever it want. As we see here, compilers often align/pad

On portable C programming (was: libraw1394 struct layouts...)

2009-01-07 Thread Ben Scott
On Wed, Jan 7, 2009 at 11:31 PM, virgins...@vfemail.net wrote: So what's the recommended way to do this? I dunno that there really is any really good way. One way might be to expose a function/method for accessing each structure member. That's probably the only truly portable way, but