filename | src/paths.c |
changeset | 866:86cd01c2b2d3 |
author | nkeynes |
date | Thu Oct 30 05:50:21 2008 +0000 (15 years ago) |
permissions | -rw-r--r-- |
last change | Fix x86-64 build (typos et al) Remove Push/pop ebx - don't really need it and saves adding more target-specific asm |
file | annotate | diff | log | raw |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00001.2 +++ b/src/paths.c Thu Oct 30 05:50:21 2008 +00001.3 @@ -0,0 +1,66 @@1.4 +/**1.5 + * $Id: cocoaui.c 863 2008-09-06 05:21:57Z nkeynes $1.6 + *1.7 + * Wrappers for system-dependent functions (mainly path differences)1.8 + *1.9 + * Copyright (c) 2008 Nathan Keynes.1.10 + *1.11 + * This program is free software; you can redistribute it and/or modify1.12 + * it under the terms of the GNU General Public License as published by1.13 + * the Free Software Foundation; either version 2 of the License, or1.14 + * (at your option) any later version.1.15 + *1.16 + * This program is distributed in the hope that it will be useful,1.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1.19 + * GNU General Public License for more details.1.20 + */1.21 +1.22 +#include <string.h>1.23 +1.24 +#include "lxdream.h"1.25 +1.26 +/* Bundle builds need to use different paths from ordinary builds, since1.27 + * the message catalogs, default config, etc are all bundle-relative.1.28 + * Otherwise paths use the standard unix install paths1.29 + */1.30 +#ifdef OSX_BUNDLE1.31 +1.32 +#include <AppKit/AppKit.h>1.33 +1.34 +static char *bundle_resource_path = NULL;1.35 +1.36 +static char *get_bundle_resource_path()1.37 +{1.38 + if( bundle_resource_path == NULL ) {1.39 + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];1.40 + NSString *resourcePath = [[NSBundle mainBundle] resourcePath];1.41 + bundle_resource_path = strdup([resourcePath UTF8String]);1.42 + [pool release];1.43 + }1.44 + return bundle_resource_path;1.45 +}1.46 +1.47 +const char *get_sysconf_path()1.48 +{1.49 + return get_bundle_resource_path();1.50 +}1.51 +1.52 +const char *get_locale_path()1.53 +{1.54 + return get_bundle_resource_path();1.55 +}1.56 +1.57 +#else1.58 +1.59 +const char *get_sysconf_path()1.60 +{1.61 + return PACKAGE_CONF_DIR;1.62 +}1.63 +1.64 +const char *get_locale_path()1.65 +{1.66 + return PACKAGE_LOCALE_DIR;1.67 +}1.68 +1.69 +#endif
.