Search
lxdream.org :: lxdream/src/paths_unix.c
lxdream 0.9.1
released Jun 29
Download Now
filename src/paths_unix.c
changeset 1241:74f8e11ab4b8
prev1038:f220d18c0615
next1296:30ecee61f811
author nkeynes
date Fri Mar 02 23:49:10 2012 +1000 (8 years ago)
permissions -rw-r--r--
last change Android WIP:
* Rename gui_jni.c to gui_android.c - now quite android specific.
* Implement generic EGL driver with very minimal Java wrapper
* Run emulation in separate thread, and implement simple queue for
inter-thread communication.
* Add menu/action-bar items for start + reset
view annotate diff log raw
     1 /**
     2  * $Id$
     3  *
     4  * Wrappers for system-dependent functions (mainly path differences)
     5  *
     6  * Copyright (c) 2008 Nathan Keynes.
     7  *
     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.
    12  *
    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.
    17  */
    19 #include <string.h>
    20 #include <stdlib.h>
    21 #include <glib/gstrfuncs.h>
    23 #include "lxdream.h"
    24 #include "config.h"
    26 const char *get_sysconf_path()
    27 {
    28     return PACKAGE_CONF_DIR;
    29 }
    31 const char *get_locale_path()
    32 {
    33     return PACKAGE_LOCALE_DIR;
    34 }
    36 const char *get_plugin_path()
    37 {
    38     return PACKAGE_PLUGIN_DIR;
    39 }
    41 static char *user_data_path = NULL;
    43 const char *get_user_data_path()
    44 {
    45     if( user_data_path == NULL ) {
    46         char *home = getenv("HOME");
    47         user_data_path = g_strdup_printf( "%s/.lxdream", home );
    48     }
    49     return user_data_path;
    50 }
    52 void set_user_data_path( const char *p ) 
    53 {
    54     g_free(user_data_path);
    55     user_data_path = g_strdup(p);
    56 }
    58 const char *get_user_home_path()
    59 {
    60     return getenv("HOME");
    61 }
.