(ITCarbonSupport) Rewrite FCC utilities, add "extern"
[ITFoundation.git] / ITCarbonSupport.m
1 #import "ITCarbonSupport.h"
2
3 NSString *NSStringFromFourCharCode(unsigned long code) {
4         return [NSString stringWithFormat:@"%.4s", &code];
5 }
6
7 unsigned long FourCharCodeFromNSString(NSString *string) {
8         const unsigned char *c_s = [string UTF8String];
9     unsigned long tmp = *c_s++;
10     tmp <<= 8;
11     tmp |= *c_s++;
12     tmp <<= 8;
13     tmp |= *c_s++;
14     tmp <<= 8;
15     return tmp |= *c_s++;
16 }