Fix:map_csv:Disable default notification of each deleted item.
[profile/ivi/navit.git] / navit / navit / start_apple.m
1 /**
2  * Navit, a modular navigation system.
3  * Copyright (C) 2005-2008 Navit Team
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * version 2 as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA  02110-1301, USA.
18  */
19
20 #include "start_real.h"
21 #import <Foundation/Foundation.h>
22 #include <glib.h>
23 #include <stdlib.h>
24
25 int
26 main(int argc, char **argv)
27 {
28         int ret;
29         NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
30         NSString *appFolderPath = [[NSBundle mainBundle] resourcePath];
31         NSString *locale = [[NSLocale currentLocale] localeIdentifier]; 
32         char *lang=g_strdup_printf("%s.UTF-8",[locale UTF8String]);
33         dbg(0,"lang %s\n",lang);
34         setenv("LANG",lang,0);
35         setlocale(LC_ALL, NULL);
36
37         const char *s=[appFolderPath UTF8String];
38         char *user=g_strdup_printf("%s/../Documents",s);
39         chdir(s);
40         argv[0]=g_strdup_printf("%s/bin/navit",s);
41         setenv("NAVIT_USER_DATADIR",user,0);
42
43         dbg(0,"calling main_real\n");
44         ret=main_real(argc, argv);
45         g_free(argv[0]);
46         g_free(user);
47         [pool release];
48         return ret;
49 }