*/
#import <Cocoa/Cocoa.h>
+#include <crt_externs.h>
#include "qemu-common.h"
#include "console.h"
int bitsPerPixel;
} QEMUScreen;
-int qemu_main(int argc, char **argv); // main defined in qemu/vl.c
NSWindow *normalWindow;
-id cocoaView;
static DisplayChangeListener *dcl;
int gArgc;
- (QEMUScreen) gscreen;
@end
+QemuCocoaView *cocoaView;
+
@implementation QemuCocoaView
- (id)initWithFrame:(NSRect)frameRect
{
COCOA_DEBUG("QemuCocoaAppController: startEmulationWithArgc\n");
int status;
- status = qemu_main(argc, argv);
+ status = qemu_main(argc, argv, *_NSGetEnviron());
exit(status);
}
UInt32 hi;
} CPSProcessSerNum;
-extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
-extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
-extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
+OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
+OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
+OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
int main (int argc, const char * argv[]) {
/* In case we don't need to display a window, let's not do that */
for (i = 1; i < argc; i++) {
- if (!strcmp(argv[i], "-vnc") ||
- !strcmp(argv[i], "-nographic") ||
- !strcmp(argv[i], "-curses")) {
- return qemu_main(gArgc, gArgv);
+ const char *opt = argv[i];
+
+ if (opt[0] == '-') {
+ /* Treat --foo the same as -foo. */
+ if (opt[1] == '-') {
+ opt++;
+ }
+ if (!strcmp(opt, "-h") || !strcmp(opt, "-help") ||
+ !strcmp(opt, "-vnc") ||
+ !strcmp(opt, "-nographic") ||
+ !strcmp(opt, "-version") ||
+ !strcmp(opt, "-curses")) {
+ return qemu_main(gArgc, gArgv, *_NSGetEnviron());
+ }
}
}