2007-01-03 05:41:16 +00:00
|
|
|
#include <Foundation/Foundation.h>
|
|
|
|
#include <EOAccess/EOAccess.h>
|
|
|
|
#include <EOControl/EOControl.h>
|
|
|
|
|
2007-05-01 20:51:18 +00:00
|
|
|
int
|
|
|
|
main(int arcg, char *argv[], char **envp)
|
2007-01-03 05:41:16 +00:00
|
|
|
{
|
|
|
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
2007-01-05 15:06:22 +00:00
|
|
|
EOModelGroup *modelGroup = [EOModelGroup defaultGroup];
|
|
|
|
EOModel *model = [modelGroup modelNamed:@"library"];
|
|
|
|
EOAdaptor *adaptor;
|
|
|
|
EOAdaptorContext *context;
|
|
|
|
EOAdaptorChannel *channel;
|
|
|
|
|
2007-05-01 20:51:18 +00:00
|
|
|
/* Tools don't have resources so we have to add the model manually. */
|
2007-01-05 15:06:22 +00:00
|
|
|
if (!model)
|
|
|
|
{
|
2007-05-01 20:51:18 +00:00
|
|
|
NSString *path = @"./library.eomodel";
|
|
|
|
model = [[EOModel alloc] initWithContentsOfFile: path];
|
2007-01-05 15:06:22 +00:00
|
|
|
[modelGroup addModel:model];
|
2007-05-01 20:51:18 +00:00
|
|
|
[model release];
|
2007-01-05 15:06:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
adaptor = [EOAdaptor adaptorWithName:[model adaptorName]];
|
|
|
|
context = [adaptor createAdaptorContext];
|
|
|
|
channel = [context createAdaptorChannel];
|
2007-01-03 05:41:16 +00:00
|
|
|
|
|
|
|
[channel openChannel];
|
|
|
|
|
|
|
|
/* insert code here */
|
|
|
|
|
|
|
|
[channel closeChannel];
|
|
|
|
[pool release];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|