1 #include <msp/core/application.h>
2 #include <msp/core/environ.h>
7 extern "C" unsigned get_home_dir(char *, unsigned);
8 extern "C" unsigned get_application_support_dir(char *, unsigned);
16 unsigned len = ::get_home_dir(buf, sizeof(buf));
18 return string(buf, len);
20 string home = getenv("HOME");
27 Path get_user_data_dir()
29 const string &appname = Application::get_name();
31 throw logic_error("no application name");
34 unsigned len = get_application_support_dir(buf, sizeof(buf));
36 return Path(string(buf, len))/appname;
37 return get_home_dir()/"Library"/"Application Support"/appname;