Blender  V2.93
BKE_appdir.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 #pragma once
17 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 struct ListBase;
27 
28 void BKE_appdir_init(void);
29 void BKE_appdir_exit(void);
30 
31 /* note on naming: typical _get() suffix is omitted here,
32  * since its the main purpose of the API. */
33 const char *BKE_appdir_folder_default(void);
34 const char *BKE_appdir_folder_home(void);
35 bool BKE_appdir_folder_documents(char *dir);
36 bool BKE_appdir_folder_id_ex(const int folder_id,
37  const char *subfolder,
38  char *path,
39  size_t path_len);
40 const char *BKE_appdir_folder_id(const int folder_id, const char *subfolder);
41 const char *BKE_appdir_folder_id_create(const int folder_id, const char *subfolder);
42 const char *BKE_appdir_folder_id_user_notest(const int folder_id, const char *subfolder);
43 const char *BKE_appdir_folder_id_version(const int folder_id,
44  const int version,
45  const bool check_is_dir);
46 
49 bool BKE_appdir_app_template_id_search(const char *app_template, char *path, size_t path_len);
51 void BKE_appdir_app_templates(struct ListBase *templates);
52 
53 /* Initialize path to program executable */
54 void BKE_appdir_program_path_init(const char *argv0);
55 
56 const char *BKE_appdir_program_path(void);
57 const char *BKE_appdir_program_dir(void);
58 
59 /* Return OS fonts directory. */
60 bool BKE_appdir_font_folder_default(char *dir);
61 
62 /* find python executable */
63 bool BKE_appdir_program_python_search(char *fullpath,
64  const size_t fullpath_len,
65  const int version_major,
66  const int version_minor);
67 
68 /* Initialize path to temporary directory. */
69 void BKE_tempdir_init(const char *userdir);
70 
71 const char *BKE_tempdir_base(void);
72 const char *BKE_tempdir_session(void);
73 void BKE_tempdir_session_purge(void);
74 
75 /* folder_id */
76 enum {
77  /* general, will find based on user/local/system priority */
79 
80  /* user-specific */
85 
86  /* system */
90 };
91 
92 /* for BKE_appdir_folder_id_version only */
93 enum {
97 };
98 
99 #define BLENDER_STARTUP_FILE "startup.blend"
100 #define BLENDER_USERPREF_FILE "userpref.blend"
101 #define BLENDER_QUIT_FILE "quit.blend"
102 #define BLENDER_BOOKMARK_FILE "bookmarks.txt"
103 #define BLENDER_HISTORY_FILE "recent-files.txt"
104 #define BLENDER_PLATFORM_SUPPORT_FILE "platform_support.txt"
105 
106 #ifdef __cplusplus
107 }
108 #endif
bool BKE_appdir_app_template_any(void)
Definition: appdir.c:987
@ BLENDER_USER_DATAFILES
Definition: BKE_appdir.h:82
@ BLENDER_SYSTEM_DATAFILES
Definition: BKE_appdir.h:87
@ BLENDER_DATAFILES
Definition: BKE_appdir.h:78
@ BLENDER_SYSTEM_PYTHON
Definition: BKE_appdir.h:89
@ BLENDER_SYSTEM_SCRIPTS
Definition: BKE_appdir.h:88
@ BLENDER_USER_AUTOSAVE
Definition: BKE_appdir.h:84
@ BLENDER_USER_CONFIG
Definition: BKE_appdir.h:81
@ BLENDER_USER_SCRIPTS
Definition: BKE_appdir.h:83
const char * BKE_appdir_folder_id_version(const int folder_id, const int version, const bool check_is_dir)
Definition: appdir.c:764
const char * BKE_appdir_folder_id_create(const int folder_id, const char *subfolder)
Definition: appdir.c:735
void BKE_tempdir_init(const char *userdir)
Definition: appdir.c:1160
bool BKE_appdir_font_folder_default(char *dir)
Definition: appdir.c:224
const char * BKE_appdir_folder_default(void)
Definition: appdir.c:157
bool BKE_appdir_app_is_portable_install(void)
Definition: appdir.c:399
bool BKE_appdir_program_python_search(char *fullpath, const size_t fullpath_len, const int version_major, const int version_minor)
Definition: appdir.c:897
bool BKE_appdir_folder_documents(char *dir)
Definition: appdir.c:190
void BKE_appdir_init(void)
Definition: appdir.c:111
bool BKE_appdir_app_template_has_userpref(const char *app_template)
Definition: appdir.c:1013
void BKE_appdir_app_templates(struct ListBase *templates)
Definition: appdir.c:1033
void BKE_appdir_exit(void)
Definition: appdir.c:119
void BKE_tempdir_session_purge(void)
Definition: appdir.c:1190
const char * BKE_appdir_folder_id(const int folder_id, const char *subfolder)
Definition: appdir.c:674
bool BKE_appdir_folder_id_ex(const int folder_id, const char *subfolder, char *path, size_t path_len)
Definition: appdir.c:570
void BKE_appdir_program_path_init(const char *argv0)
Definition: appdir.c:873
const char * BKE_appdir_folder_home(void)
Definition: appdir.c:175
const char * BKE_tempdir_session(void)
bool BKE_appdir_app_template_id_search(const char *app_template, char *path, size_t path_len)
Definition: appdir.c:1001
const char * BKE_tempdir_base(void)
Definition: appdir.c:1182
const char * BKE_appdir_program_path(void)
Definition: appdir.c:882
@ BLENDER_RESOURCE_PATH_SYSTEM
Definition: BKE_appdir.h:96
@ BLENDER_RESOURCE_PATH_LOCAL
Definition: BKE_appdir.h:95
@ BLENDER_RESOURCE_PATH_USER
Definition: BKE_appdir.h:94
const char * BKE_appdir_program_dir(void)
Definition: appdir.c:891
const char * BKE_appdir_folder_id_user_notest(const int folder_id, const char *subfolder)
Definition: appdir.c:686
char app_template[64]
Definition: wm_files.c:853