My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Checkout   Browse   Changes  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// main.m
// UndocumentedGoodness
//
// Created by Nicholas Jitkoff on 3/19/08.
// Copyright Google Inc 2008. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "QLUIPrivate.h"
#import "CPSPrivate.h"
#import "CGSPrivate.h"
#import "CoreDockPrivate.h"
#import "DCSPrivate.h"
#import "CalculatePrivate.h"

int main(int argc, char *argv[])
{
[NSAutoreleasePool new];

NSLog(@"CALCULATE");
char result[1024];
OSStatus success = CalculatePerformExpression("pi * 2000", 100, 1, result);
NSLog(@"pi*2000 = %d %s", success, result);

NSLog(@"DEFINE");
NSString *word = @"onomatopoeia";
NSLog(@"%@", (NSString *)DCSCopyTextDefinition (NULL, (CFStringRef)word, CFRangeMake(0, [word length])));

NSURL *url = [NSURL fileURLWithPath:@"/Library/Dictionaries/New Oxford American Dictionary.dictionary"];

CFTypeRef dictionary = DCSDictionaryCreate((CFURLRef) url);
CFArrayRef records = DCSCopyRecordsForSearchString(dictionary, (CFStringRef)word, 0, 0);

for (id record in (NSArray *)records) {
NSLog(@"dict %@", DCSRecordCopyData(record) );
}
return 0;//NSApplicationMain(argc, (const char **) argv);
}

Change log

r18 by dmaclach on Sep 11, 2009   Diff
Fix up QLUIPrivate so that it builds
cleanly in 64 bit.
Cleaned up some warnings in main.

Go to: 
Project members, sign in to write a code review

Older revisions

r12 by jnj on Mar 19, 2008   Diff
Clean up spacing
r11 by jnj on Mar 19, 2008   Diff
Added dictionary and calculate
r10 by jnj on Mar 19, 2008   Diff
Added test project, c++ bracketing
All revisions of this file

File info

Size: 1147 bytes, 39 lines
Powered by Google Project Hosting