6 #import <Foundation/Foundation.h>
10 #define ALL_RECORDS @"/tmp/all.nsarray"
13 #define MAX(a,b) (((a)>(b))?(a):(b))
17 int main(int argc, char **argv, char **env) {
18 NSAutoreleasePool *pool;
20 unsigned int i, count, maxLength;
21 NSString *longestMailto;
23 pool = [[NSAutoreleasePool alloc] init];
24 #if LIB_FOUNDATION_LIBRARY
25 [NSProcessInfo initializeWithArguments:argv count:argc environment:env];
28 records = [NSArray arrayWithContentsOfFile:ALL_RECORDS];
29 count = [records count];
32 for(i = 0; i < count; i++) {
36 mailto = [[records objectAtIndex:i] objectForKey:@"mailto"];
37 length = [mailto length];
38 maxLength = MAX(maxLength, length);
39 if(length == maxLength)
40 longestMailto = mailto;
42 printf("\nTotal: %d\nMaxlength: %d\nlongest: %s\n", count, maxLength, [longestMailto cString]);