116 fsm_iter = fsm_iter->
next)
126 return fsentry->
path;
131 if ((!fsentry->
path || !path || !
STREQ(path, fsentry->
path)) && (fsentry->
path != path)) {
141 if (user_config_dir.has_value()) {
150 return (fsentry->
icon) ? fsentry->
icon : ICON_FILE_FOLDER;
155 fsentry->
icon = icon;
177 if (fsentry->
name[0]) {
178 return fsentry->
name;
183 size_t name_size =
sizeof(fsentry->
name) - 1;
193 size_t tmp_name_size =
sizeof(tmp_name);
198 fsentry->
name[0] =
'\0';
207 if (user_config_dir.has_value()) {
219 fsm_iter = fsm_iter->
next)
224 return fsm_iter ? fsm_iter->
save : 0;
243 const uint path_len = strlen(path);
249 const bool has_trailing_slash = (path[path_len - 1] ==
SEP);
257 for (fsm_iter = fsm_head; fsm_iter; fsm_prev = fsm_iter, fsm_iter = fsm_iter->
next) {
258 if (fsm_iter->
path) {
261 if (cmp_ret == 0 &&
STREQ(fsm_iter->
path + path_len, has_trailing_slash ?
"" :
SEP_STR)) {
263 if (fsm_iter != fsm_head) {
265 fsm_iter->
next = fsm_head;
306 for (; tfsm; tfsm = tfsm->
next) {
325 fsm_iter->
name[0] =
'\0';
332 fsm_iter->
next = fsm_head;
337 fsm_prev->
next = fsm_iter;
341 fsm_iter->
next = fsm_head;
354 for (fsm_iter = fsm_head; fsm_iter && idx; fsm_prev = fsm_iter, fsm_iter = fsm_iter->
next) {
362 if (fsm_iter->
save && fsm_iter->
path) {
369 fsm_head = fsm_iter->
next;
390 bool has_error =
false;
391 has_error |= (fprintf(fp,
"[Bookmarks]\n") < 0);
393 fsm_iter = fsm_iter->
next)
395 if (fsm_iter->
path && fsm_iter->
save) {
398 has_error |= (fprintf(fp,
"!%s\n", fsm_iter->
name) < 0);
400 has_error |= (fprintf(fp,
"%s\n", fsm_iter->
path) < 0);
403 has_error = (fprintf(fp,
"[Recent]\n") < 0);
406 fsm_iter = fsm_iter->
next, nwritten++)
408 if (fsm_iter->
path && fsm_iter->
save) {
411 has_error |= (fprintf(fp,
"!%s\n", fsm_iter->
name) < 0);
413 has_error |= (fprintf(fp,
"%s\n", fsm_iter->
path) < 0);
435 while (fgets(line,
sizeof(line), fp) !=
nullptr) {
442 else if (line[0] ==
'!') {
443 int len = strlen(line);
445 if (line[
len - 1] ==
'\n') {
446 line[
len - 1] =
'\0';
452 int len = strlen(line);
454 if (line[
len - 1] ==
'\n') {
455 line[
len - 1] =
'\0';
476 if (fsm_iter->
path) {
499 if (*fsmenu !=
nullptr) {
521 for (
i = 0; fsm_iter; fsm_iter = fsm_iter->
next,
i++) {
#define BLENDER_BOOKMARK_FILE
std::optional< std::string > BKE_appdir_folder_id_create(int folder_id, const char *subfolder) ATTR_WARN_UNUSED_RESULT
File and directory operations.
FILE * BLI_fopen(const char *filepath, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
#define BLI_path_join(...)
bool BLI_path_is_rel(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
bool BLI_path_name_at_index(const char *__restrict path, int index, int *__restrict r_offset, int *__restrict r_len) ATTR_NONNULL(1
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
char * STRNCPY(char(&dst)[N], const char *src)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define BLI_string_joinN(...)
@ FS_CATEGORY_SYSTEM_BOOKMARKS
Read Guarded memory(de)allocation.
void * MEM_mallocN(size_t len, const char *str)
void * MEM_callocN(size_t len, const char *str)
void MEM_freeN(void *vmemh)