1 #include <msp/core/application.h>
6 extern "C" unsigned get_home_dir(char *, unsigned);
7 extern "C" unsigned get_application_support_dir(char *, unsigned);
15 unsigned len = ::get_home_dir(buf, sizeof(buf));
17 return string(buf, len);
19 const char *home = getenv("HOME");
26 Path get_user_data_dir(const string &)
28 return get_user_data_dir();
31 Path get_user_data_dir()
33 const string &appname = Application::get_name();
35 throw logic_error("no application name");
38 unsigned len = get_application_support_dir(buf, sizeof(buf));
40 return Path(string(buf, len))/appname;
41 return get_home_dir()/"Library"/"Application Support"/appname;