2 * $Id: cocoaui.c 863 2008-09-06 05:21:57Z nkeynes $
4 * Wrappers for system-dependent functions (mainly path differences)
6 * Copyright (c) 2008 Nathan Keynes.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
23 /* Bundle builds need to use different paths from ordinary builds, since
24 * the message catalogs, default config, etc are all bundle-relative.
25 * Otherwise paths use the standard unix install paths
29 #include <AppKit/AppKit.h>
31 static char *bundle_resource_path = NULL;
33 static char *get_bundle_resource_path()
35 if( bundle_resource_path == NULL ) {
36 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
37 NSString *resourcePath = [[NSBundle mainBundle] resourcePath];
38 bundle_resource_path = strdup([resourcePath UTF8String]);
41 return bundle_resource_path;
44 const char *get_sysconf_path()
46 return get_bundle_resource_path();
49 const char *get_locale_path()
51 return get_bundle_resource_path();
56 const char *get_sysconf_path()
58 return PACKAGE_CONF_DIR;
61 const char *get_locale_path()
63 return PACKAGE_LOCALE_DIR;
.