Пример #1
0
const char * osal_get_user_cachepath(void)
{
    static char retpath[PATH_MAX];
    int rval;
    
    /* first, try the XDG_CACHE_HOME environment variable */
    rval = get_xdg_dir(retpath, "XDG_CACHE_HOME", "mupen64plus/");
    if (rval == 0)
        return retpath;

    /* then try the HOME environment variable */
    rval = get_xdg_dir(retpath, "HOME", ".cache/mupen64plus/");
    if (rval == 0)
        return retpath;

    /* otherwise we are in trouble */
    if (rval < 3)
        DebugMessage(M64MSG_ERROR, "Failed to get cache directory; $HOME is undefined or invalid.");
    return NULL;
}
Пример #2
0
const char * osal_get_user_datapath(void)
{
    static char retpath[PATH_MAX];
    int rval;
    
    strcpy(retpath,"shared/misc/n64/");
    return retpath;

    /* first, try the XDG_DATA_HOME environment variable */
    rval = get_xdg_dir(retpath, "XDG_DATA_HOME", "mupen64plus/");
    if (rval == 0)
        return retpath;

    /* then try the HOME environment variable */
    rval = get_xdg_dir(retpath, "HOME", ".local/share/mupen64plus/");
    if (rval == 0)
        return retpath;

    /* otherwise we are in trouble */
    if (rval < 3)
        DebugMessage(M64MSG_ERROR, "Failed to get data directory; $HOME is undefined or invalid.");
    return NULL;
}