From: Holger Schemel Date: Sat, 11 Nov 2017 19:31:57 +0000 (+0100) Subject: changed function from static to public X-Git-Tag: 4.1.0.0~54 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=56e8cd68c1f2489bbf98ca1e604925b699ae0a44;p=rocksndiamonds.git changed function from static to public --- diff --git a/src/libgame/setup.c b/src/libgame/setup.c index affc9365..1a7972be 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -114,22 +114,6 @@ static char *getLevelClassDescription(TreeInfo *ti) return "Unknown Level Class"; } -static char *getUserLevelDir(char *level_subdir) -{ - static char *userlevel_dir = NULL; - char *data_dir = getUserGameDataDir(); - char *userlevel_subdir = LEVELS_DIRECTORY; - - checked_free(userlevel_dir); - - if (level_subdir != NULL) - userlevel_dir = getPath3(data_dir, userlevel_subdir, level_subdir); - else - userlevel_dir = getPath2(data_dir, userlevel_subdir); - - return userlevel_dir; -} - static char *getScoreDir(char *level_subdir) { static char *score_dir = NULL; @@ -197,6 +181,22 @@ static char *getLevelDirFromTreeInfo(TreeInfo *node) return level_dir; } +char *getUserLevelDir(char *level_subdir) +{ + static char *userlevel_dir = NULL; + char *data_dir = getUserGameDataDir(); + char *userlevel_subdir = LEVELS_DIRECTORY; + + checked_free(userlevel_dir); + + if (level_subdir != NULL) + userlevel_dir = getPath3(data_dir, userlevel_subdir, level_subdir); + else + userlevel_dir = getPath2(data_dir, userlevel_subdir); + + return userlevel_dir; +} + char *getCurrentLevelDir() { return getLevelDirFromTreeInfo(leveldir_current); diff --git a/src/libgame/setup.h b/src/libgame/setup.h index 2f1f65a9..5fad3752 100644 --- a/src/libgame/setup.h +++ b/src/libgame/setup.h @@ -271,6 +271,7 @@ char *getCommonDataDir(void); char *getPersonalDataDir(void); char *getUserGameDataDir(void); char *getSetupDir(void); +char *getUserLevelDir(char *); char *getCurrentLevelDir(void); char *getNewUserLevelSubdir(void);