Search
lxdream.org :: lxdream/src/paths.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/paths.c
changeset 866:86cd01c2b2d3
author nkeynes
date Sat Jan 03 03:30:26 2009 +0000 (15 years ago)
branchlxdream-mem
permissions -rw-r--r--
last change MMU work-in-progress
* Move SDRAM out into separate sdram.c
* Move all page-table management into mmu.c
* Convert UTLB management to use the new page-tables
* Rip out all calls to mmu_vma_to_phys_* and replace with direct access
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/paths.c Sat Jan 03 03:30:26 2009 +0000
1.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 modify
1.12 + * it under the terms of the GNU General Public License as published by
1.13 + * the Free Software Foundation; either version 2 of the License, or
1.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 of
1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.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, since
1.27 + * the message catalogs, default config, etc are all bundle-relative.
1.28 + * Otherwise paths use the standard unix install paths
1.29 + */
1.30 +#ifdef OSX_BUNDLE
1.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 +#else
1.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
.