Lines Matching refs:search_ctx

196 static void ff_push(ff_search_ctx_T *search_ctx, ff_stack_T *stack_ptr);
197 static ff_stack_T *ff_pop(ff_search_ctx_T *search_ctx);
198 static void ff_clear(ff_search_ctx_T *search_ctx);
315 ff_search_ctx_T *search_ctx; in vim_findfile_init() local
320 search_ctx = search_ctx_arg; in vim_findfile_init()
323 search_ctx = ALLOC_CLEAR_ONE(ff_search_ctx_T); in vim_findfile_init()
324 if (search_ctx == NULL) in vim_findfile_init()
327 search_ctx->ffsc_find_what = find_what; in vim_findfile_init()
328 search_ctx->ffsc_tagfile = tagfile; in vim_findfile_init()
331 ff_clear(search_ctx); in vim_findfile_init()
335 vim_findfile_free_visited(search_ctx); in vim_findfile_init()
341 search_ctx->ffsc_visited_list = ff_get_visited_list(filename, in vim_findfile_init()
342 &search_ctx->ffsc_visited_lists_list); in vim_findfile_init()
343 if (search_ctx->ffsc_visited_list == NULL) in vim_findfile_init()
345 search_ctx->ffsc_dir_visited_list = ff_get_visited_list(filename, in vim_findfile_init()
346 &search_ctx->ffsc_dir_visited_lists_list); in vim_findfile_init()
347 if (search_ctx->ffsc_dir_visited_list == NULL) in vim_findfile_init()
371 search_ctx->ffsc_start_dir = FullName_save(ff_expand_buffer, FALSE); in vim_findfile_init()
374 search_ctx->ffsc_start_dir = vim_strnsave(rel_fname, len); in vim_findfile_init()
375 if (search_ctx->ffsc_start_dir == NULL) in vim_findfile_init()
400 search_ctx->ffsc_start_dir = vim_strsave(ff_expand_buffer); in vim_findfile_init()
401 if (search_ctx->ffsc_start_dir == NULL) in vim_findfile_init()
409 && search_ctx->ffsc_start_dir[1] == ':') in vim_findfile_init()
410 search_ctx->ffsc_start_dir[2] = NUL; in vim_findfile_init()
433 search_ctx->ffsc_stopdirs_v = ALLOC_ONE(char_u *); in vim_findfile_init()
435 if (search_ctx->ffsc_stopdirs_v != NULL) in vim_findfile_init()
443 ptr = vim_realloc(search_ctx->ffsc_stopdirs_v, in vim_findfile_init()
446 search_ctx->ffsc_stopdirs_v = ptr; in vim_findfile_init()
453 search_ctx->ffsc_stopdirs_v[dircount-1] = in vim_findfile_init()
460 search_ctx->ffsc_stopdirs_v[dircount-1] = in vim_findfile_init()
466 search_ctx->ffsc_stopdirs_v[dircount-1] = NULL; in vim_findfile_init()
472 search_ctx->ffsc_level = level; in vim_findfile_init()
487 search_ctx->ffsc_fix_path = vim_strnsave(path, wc_part - path); in vim_findfile_init()
531 search_ctx->ffsc_wc_path = vim_strsave(ff_expand_buffer); in vim_findfile_init()
533 if (search_ctx->ffsc_wc_path == NULL) in vim_findfile_init()
538 search_ctx->ffsc_fix_path = vim_strsave(path); in vim_findfile_init()
540 if (search_ctx->ffsc_start_dir == NULL) in vim_findfile_init()
544 search_ctx->ffsc_start_dir = vim_strsave(search_ctx->ffsc_fix_path); in vim_findfile_init()
545 if (search_ctx->ffsc_start_dir == NULL) in vim_findfile_init()
547 search_ctx->ffsc_fix_path[0] = NUL; in vim_findfile_init()
551 if (STRLEN(search_ctx->ffsc_start_dir) in vim_findfile_init()
552 + STRLEN(search_ctx->ffsc_fix_path) + 3 >= MAXPATHL) in vim_findfile_init()
557 STRCPY(ff_expand_buffer, search_ctx->ffsc_start_dir); in vim_findfile_init()
562 + (int)STRLEN(search_ctx->ffsc_fix_path) + 1); in vim_findfile_init()
565 STRCPY(buf + eb_len, search_ctx->ffsc_fix_path); in vim_findfile_init()
568 STRCAT(ff_expand_buffer, search_ctx->ffsc_fix_path); in vim_findfile_init()
574 char_u *p = gettail(search_ctx->ffsc_fix_path); in vim_findfile_init()
579 if (p > search_ctx->ffsc_fix_path) in vim_findfile_init()
582 len = (int)(p - search_ctx->ffsc_fix_path) - 1; in vim_findfile_init()
584 && STRNCMP(search_ctx->ffsc_fix_path, "..", 2) == 0) in vim_findfile_init()
586 || search_ctx->ffsc_fix_path[2] == PATHSEP)) in vim_findfile_init()
591 STRNCAT(ff_expand_buffer, search_ctx->ffsc_fix_path, len); in vim_findfile_init()
595 len = (int)STRLEN(search_ctx->ffsc_fix_path); in vim_findfile_init()
597 if (search_ctx->ffsc_wc_path != NULL) in vim_findfile_init()
599 wc_path = vim_strsave(search_ctx->ffsc_wc_path); in vim_findfile_init()
600 temp = alloc(STRLEN(search_ctx->ffsc_wc_path) in vim_findfile_init()
601 + STRLEN(search_ctx->ffsc_fix_path + len) in vim_findfile_init()
611 STRCPY(temp, search_ctx->ffsc_fix_path + len); in vim_findfile_init()
612 STRCAT(temp, search_ctx->ffsc_wc_path); in vim_findfile_init()
613 vim_free(search_ctx->ffsc_wc_path); in vim_findfile_init()
615 search_ctx->ffsc_wc_path = temp; in vim_findfile_init()
624 search_ctx->ffsc_wc_path, in vim_findfile_init()
631 ff_push(search_ctx, sptr); in vim_findfile_init()
633 search_ctx->ffsc_file_to_search = vim_strsave(filename); in vim_findfile_init()
634 if (search_ctx->ffsc_file_to_search == NULL) in vim_findfile_init()
637 return search_ctx; in vim_findfile_init()
645 vim_findfile_cleanup(search_ctx); in vim_findfile_init()
723 ff_search_ctx_T *search_ctx; in vim_findfile() local
728 search_ctx = (ff_search_ctx_T *)search_ctx_arg; in vim_findfile()
739 if (search_ctx->ffsc_start_dir != NULL) in vim_findfile()
740 path_end = &search_ctx->ffsc_start_dir[ in vim_findfile()
741 STRLEN(search_ctx->ffsc_start_dir)]; in vim_findfile()
758 stackp = ff_pop(search_ctx); in vim_findfile()
782 && ff_check_visited(&search_ctx->ffsc_dir_visited_list in vim_findfile()
842 && search_ctx->ffsc_start_dir) in vim_findfile()
844 if (STRLEN(search_ctx->ffsc_start_dir) + 1 < MAXPATHL) in vim_findfile()
846 STRCPY(file_path, search_ctx->ffsc_start_dir); in vim_findfile()
984 + STRLEN(search_ctx->ffsc_file_to_search) in vim_findfile()
989 STRCAT(file_path, search_ctx->ffsc_file_to_search); in vim_findfile()
1003 if (search_ctx->ffsc_tagfile) in vim_findfile()
1013 && (search_ctx->ffsc_find_what in vim_findfile()
1015 || ((search_ctx->ffsc_find_what in vim_findfile()
1020 &search_ctx->ffsc_visited_list->ffvl_visited_list, in vim_findfile()
1031 &search_ctx->ffsc_visited_list->ffvl_visited_list, in vim_findfile()
1053 ff_push(search_ctx, stackp); in vim_findfile()
1101 ff_push(search_ctx, in vim_findfile()
1128 ff_push(search_ctx, in vim_findfile()
1143 if (search_ctx->ffsc_start_dir in vim_findfile()
1144 && search_ctx->ffsc_stopdirs_v != NULL && !got_int) in vim_findfile()
1149 if (ff_path_in_stoplist(search_ctx->ffsc_start_dir, in vim_findfile()
1150 (int)(path_end - search_ctx->ffsc_start_dir), in vim_findfile()
1151 search_ctx->ffsc_stopdirs_v) == TRUE) in vim_findfile()
1155 while (path_end > search_ctx->ffsc_start_dir in vim_findfile()
1158 while (path_end > search_ctx->ffsc_start_dir in vim_findfile()
1164 if (*search_ctx->ffsc_start_dir == 0) in vim_findfile()
1167 if (STRLEN(search_ctx->ffsc_start_dir) + 1 in vim_findfile()
1168 + STRLEN(search_ctx->ffsc_fix_path) < MAXPATHL) in vim_findfile()
1170 STRCPY(file_path, search_ctx->ffsc_start_dir); in vim_findfile()
1172 STRCAT(file_path, search_ctx->ffsc_fix_path); in vim_findfile()
1179 search_ctx->ffsc_wc_path, search_ctx->ffsc_level, 0); in vim_findfile()
1182 ff_push(search_ctx, sptr); in vim_findfile()
1201 ff_search_ctx_T *search_ctx; in vim_findfile_free_visited() local
1206 search_ctx = (ff_search_ctx_T *)search_ctx_arg; in vim_findfile_free_visited()
1207 vim_findfile_free_visited_list(&search_ctx->ffsc_visited_lists_list); in vim_findfile_free_visited()
1208 vim_findfile_free_visited_list(&search_ctx->ffsc_dir_visited_lists_list); in vim_findfile_free_visited()
1511 ff_push(ff_search_ctx_T *search_ctx, ff_stack_T *stack_ptr) in ff_push() argument
1517 stack_ptr->ffs_prev = search_ctx->ffsc_stack_ptr; in ff_push()
1518 search_ctx->ffsc_stack_ptr = stack_ptr; in ff_push()
1527 ff_pop(ff_search_ctx_T *search_ctx) in ff_pop() argument
1531 sptr = search_ctx->ffsc_stack_ptr; in ff_pop()
1532 if (search_ctx->ffsc_stack_ptr != NULL) in ff_pop()
1533 search_ctx->ffsc_stack_ptr = search_ctx->ffsc_stack_ptr->ffs_prev; in ff_pop()
1560 ff_clear(ff_search_ctx_T *search_ctx) in ff_clear() argument
1565 while ((sptr = ff_pop(search_ctx)) != NULL) in ff_clear()
1568 vim_free(search_ctx->ffsc_file_to_search); in ff_clear()
1569 vim_free(search_ctx->ffsc_start_dir); in ff_clear()
1570 vim_free(search_ctx->ffsc_fix_path); in ff_clear()
1572 vim_free(search_ctx->ffsc_wc_path); in ff_clear()
1576 if (search_ctx->ffsc_stopdirs_v != NULL) in ff_clear()
1580 while (search_ctx->ffsc_stopdirs_v[i] != NULL) in ff_clear()
1582 vim_free(search_ctx->ffsc_stopdirs_v[i]); in ff_clear()
1585 vim_free(search_ctx->ffsc_stopdirs_v); in ff_clear()
1587 search_ctx->ffsc_stopdirs_v = NULL; in ff_clear()
1591 search_ctx->ffsc_file_to_search = NULL; in ff_clear()
1592 search_ctx->ffsc_start_dir = NULL; in ff_clear()
1593 search_ctx->ffsc_fix_path = NULL; in ff_clear()
1595 search_ctx->ffsc_wc_path = NULL; in ff_clear()
1596 search_ctx->ffsc_level = 0; in ff_clear()