• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Struct introspection or information
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Struct introspection or information


  • Subject: Re: Struct introspection or information
  • From: Steve Christensen <email@hidden>
  • Date: Mon, 5 Nov 2007 17:53:22 -0800

I may have misunderstood, but I thought the OP mentioned not having access to the headers that define certain C structs. If that's the case, we're talking about opaque structures from the point of view of the caller, right?


On Nov 5, 2007, at 4:34 PM, David Spooner wrote:


You might get some mileage out of the @encode() directive. It produces a c-string encoding of a c type, which (with significant effort) can be parsed in order to traverse a c structure of that type. These encodings do not contain the field names of structures, but they often contain structure tag names...


More information is available in the section "Type Encodings" of
The Objective-C 2.0 Programming Language

dave

On 5-Nov-07, at 1:33 PM, Monitus wrote:

Good day everyone - sorry if this is not totally Cocoa-related: if there's a better list for this, please let me know and accept my apologies in advance...

Is there any way to know the fields in a C structure, if you don't have the headers that define it? Or at the very least, is it possible to access it's field values?

Thanks!

Jean Le Clerc.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Struct introspection or information (From: Monitus <email@hidden>)
 >Re: Struct introspection or information (From: David Spooner <email@hidden>)

  • Prev by Date: Re: How to split large class files?
  • Next by Date: Re: Learning a word with the spell checker
  • Previous by thread: Re: Struct introspection or information
  • Next by thread: Re: Struct introspection or information
  • Index(es):
    • Date
    • Thread