diff --git a/aegisub/libosxutil/bundledirs.c b/aegisub/libosxutil/bundledirs.c index 9afa395fa..f71185b3a 100644 --- a/aegisub/libosxutil/bundledirs.c +++ b/aegisub/libosxutil/bundledirs.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2008 Niels Martin Hansen + Copyright (c) 2008-2009 Niels Martin Hansen Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -60,6 +60,11 @@ static char * GetDir(GetURLFunc GetURL) return strdup(res_dir_str); } +char * OSX_GetBundlePath() +{ + return GetDir(CFBundleCopyBundleURL); +} + char * OSX_GetBundleResourcesDirectory() { return GetDir(CFBundleCopyResourcesDirectoryURL); diff --git a/aegisub/libosxutil/libosxutil.h b/aegisub/libosxutil/libosxutil.h index f1d84242f..133bdb925 100644 --- a/aegisub/libosxutil/libosxutil.h +++ b/aegisub/libosxutil/libosxutil.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2008 Niels Martin Hansen + Copyright (c) 2008-2009 Niels Martin Hansen Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -45,6 +45,10 @@ All of the functions may return NULL on error. */ +/* Get the full name of the bundle itself. May return NULL if the current + executable is not inside a bundle. */ +char * OSX_GetBundlePath(); + /* Get the resources directory, mainly for user interface elements such as graphics and strings */ char * OSX_GetBundleResourcesDirectory();