Re: Reading Adobe Photoshop header, Obj-C
Re: Reading Adobe Photoshop header, Obj-C
- Subject: Re: Reading Adobe Photoshop header, Obj-C
- From: Stephen Hoffman <email@hidden>
- Date: Tue, 28 Jun 2011 13:47:50 -0400
On 28 Jun 2011 10:00:51 -0700, Jens Alfke <email@hidden> posited:
> Assuming Œversion‚ is a 16-bit big-endian integer, you could read it like this:
The htons() and ntohs() C calls go from host-native integer (short) format to network format (big-endian), and from network format back to host-native short ints. There are also long versions of these calls. These calls are also implemented to provide correct operations on hosts systems that are little- and big-endian; they're portable across platforms.
If you have to do more of this (at the C layer), then you might consider using the xdr external data representation calls, too.
And FWIW, going the other way (from knowing C to learning Objective C) can be "fun", too.
_______________________________________________
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