3 #import "Foundation/NSAutoreleasePool.h"
4 #import "Foundation/NSBundle.h"
5 #import "Foundation/NSException.h"
6 #import "Foundation/NSString.h"
7 #import "Foundation/NSPathUtilities.h"
11 /* This code is convoluted because Cocoa places restrictions on longjmp and
12 exception handling. In particular, a longjmp can never cross an NS_DURING,
13 NS_HANDLER or NS_ENDHANDLER. */
21 SETJMP(stack_chain->toplevel);
28 general_error(ERROR_OBJECTIVE_C,e,F,true);
34 error = tag_object(make_alien(F,(CELL)localException));
41 [[NSAutoreleasePool alloc] init];
44 const char *default_image_path(void)
46 NSBundle *bundle = [NSBundle mainBundle];
47 NSString *path = [bundle bundlePath];
49 if([path hasSuffix:@".app"] || [path hasSuffix:@".app/"])
50 image = [[path stringByDeletingLastPathComponent] stringByAppendingString:@"/factor.image"];
52 image = [path stringByAppendingString:@"/factor.image"];
53 return [image cString];
56 void init_signals(void)