BKE_appdir.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * ***** BEGIN GPL LICENSE BLOCK *****
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software Foundation,
  16. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. *
  18. * ***** END GPL LICENSE BLOCK *****
  19. */
  20. #ifndef __BKE_APPDIR_H__
  21. #define __BKE_APPDIR_H__
  22. /** \file BKE_appdir.h
  23. * \ingroup bli
  24. */
  25. /* note on naming: typical _get() suffix is omitted here,
  26. * since its the main purpose of the API. */
  27. const char *BKE_appdir_folder_default(void);
  28. const char *BKE_appdir_folder_id_ex(const int folder_id, const char *subfolder, char *path, size_t path_len);
  29. const char *BKE_appdir_folder_id(const int folder_id, const char *subfolder);
  30. const char *BKE_appdir_folder_id_create(const int folder_id, const char *subfolder);
  31. const char *BKE_appdir_folder_id_user_notest(const int folder_id, const char *subfolder);
  32. const char *BKE_appdir_folder_id_version(const int folder_id, const int ver, const bool do_check);
  33. bool BKE_appdir_app_template_any(void);
  34. bool BKE_appdir_app_template_id_search(const char *app_template, char *path, size_t path_len);
  35. /* Initialize path to program executable */
  36. void BKE_appdir_program_path_init(const char *argv0);
  37. const char *BKE_appdir_program_path(void);
  38. const char *BKE_appdir_program_dir(void);
  39. /* find python executable */
  40. bool BKE_appdir_program_python_search(
  41. char *fullpath, const size_t fullpath_len,
  42. const int version_major, const int version_minor);
  43. /* Initialize path to temporary directory. */
  44. void BKE_tempdir_init(char *userdir);
  45. void BKE_tempdir_system_init(char *dir);
  46. const char *BKE_tempdir_base(void);
  47. const char *BKE_tempdir_session(void);
  48. void BKE_tempdir_session_purge(void);
  49. /* folder_id */
  50. enum {
  51. /* general, will find based on user/local/system priority */
  52. BLENDER_DATAFILES = 2,
  53. /* user-specific */
  54. BLENDER_USER_CONFIG = 31,
  55. BLENDER_USER_DATAFILES = 32,
  56. BLENDER_USER_SCRIPTS = 33,
  57. BLENDER_USER_AUTOSAVE = 34,
  58. /* system */
  59. BLENDER_SYSTEM_DATAFILES = 52,
  60. BLENDER_SYSTEM_SCRIPTS = 53,
  61. BLENDER_SYSTEM_PYTHON = 54,
  62. };
  63. /* for BKE_appdir_folder_id_version only */
  64. enum {
  65. BLENDER_RESOURCE_PATH_USER = 0,
  66. BLENDER_RESOURCE_PATH_LOCAL = 1,
  67. BLENDER_RESOURCE_PATH_SYSTEM = 2,
  68. };
  69. #define BLENDER_STARTUP_FILE "startup.blend"
  70. #define BLENDER_USERPREF_FILE "userpref.blend"
  71. #define BLENDER_QUIT_FILE "quit.blend"
  72. #define BLENDER_BOOKMARK_FILE "bookmarks.txt"
  73. #define BLENDER_HISTORY_FILE "recent-files.txt"
  74. #endif /* __BKE_APPDIR_H__ */