Add:Core:Forgotten file
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Tue, 6 Sep 2011 18:41:35 +0000 (18:41 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Tue, 6 Sep 2011 18:41:35 +0000 (18:41 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4762 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/start_apple.m [new file with mode: 0644]

diff --git a/navit/navit/start_apple.m b/navit/navit/start_apple.m
new file mode 100644 (file)
index 0000000..d64691c
--- /dev/null
@@ -0,0 +1,42 @@
+/**
+ * Navit, a modular navigation system.
+ * Copyright (C) 2005-2008 Navit Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ */
+
+#include "start_real.h"
+#import <Foundation/Foundation.h>
+#include <glib.h>
+#include <stdlib.h>
+
+int
+main(int argc, char **argv)
+{
+       int ret;
+       NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+       NSString *appFolderPath = [[NSBundle mainBundle] resourcePath];
+       const char *s=[appFolderPath UTF8String];
+       char *user=g_strdup_printf("%s/../Documents",s);
+       chdir(s);
+       argv[0]=g_strdup_printf("%s/bin/navit",s);
+       setenv("NAVIT_USER_DATADIR",user,0);
+
+       ret=main_real(argc, argv);
+       g_free(argv[0]);
+       g_free(user);
+       [pool release];
+       return ret;
+}