• 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: deprecated FOUR_CHAR_CODE and macintel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: deprecated FOUR_CHAR_CODE and macintel


  • Subject: Re: deprecated FOUR_CHAR_CODE and macintel
  • From: email@hidden
  • Date: Thu, 12 Jan 2006 15:01:33 +0100

On 12 Jan 2006, at 14:36, email@hidden wrote:

Date: Thu, 12 Jan 2006 12:35:57 +0100
From: Olivier Tristan <email@hidden>
Subject: deprecated FOUR_CHAR_CODE and macintel
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi Guys,

I've just seen that FOUR_CHAR_CODE do not handle endianess on macintel
just as written in the docs.
By the way it's so used in general in mac apps that I find this a bit
lame but whatever...
So I was wondering which function should I use to get the same results
and which handle endianess of course ?

see "man htonl".

I expect you want something like the following?

OSType theFileType = (OSType )htonl( (uint32_t)FOUR_CHAR_CODE ( 'TEXT' ) );

I was under the impression that when you pass OSTypes to the Carbon APIs it will byte swap internally?

It seems to get swapped in AppKit when using HFS types in a file filtering array for the open panel. For instance:

[NSArray arrayWithObjects:@"txt", @"icm", @"icc", NSFileTypeForHFSTypeCode( 'prof' ), NSFileTypeForHFSTypeCode ( 'TEXT' ), nil];


Any hints is appreciated.

Thanks,

--
Olivier Tristan
Ultimate Sound Bank

_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: Just when does an application commit to PowerPC vs. Intel?
  • Next by Date: Re: Problem after upgrade
  • Previous by thread: Re: deprecated FOUR_CHAR_CODE and macintel
  • Next by thread: Re: deprecated FOUR_CHAR_CODE and macintel
  • Index(es):
    • Date
    • Thread