Lines Matching refs:dir_stack
678 name_list_list *dir_stack = NULL; in traverse() local
689 dir_stack = ber_memcalloc_x( 1, sizeof(*dir_stack), ctx ); in traverse()
690 if ( dir_stack == NULL ) goto alloc_fail; in traverse()
691 dir_stack->next = NULL; in traverse()
692 dir_stack->list = ber_memcalloc_x( 1, sizeof(name_list), ctx ); in traverse()
693 if ( dir_stack->list == NULL ) goto alloc_fail; in traverse()
694 rc = lstat( path, &dir_stack->list->st ); in traverse()
699 dir_stack->list->next = NULL; in traverse()
700 dir_stack->list->name = ber_strdup_x( path, ctx ); in traverse()
701 if ( dir_stack->list->name == NULL ) goto alloc_fail; in traverse()
703 while ( dir_stack != NULL ) { in traverse()
704 while ( dir_stack->list != NULL ) { in traverse()
707 dir_stack->list->name ); in traverse()
711 cb_rc = cb->pre_func( cb->pre_private, dir_stack->list->name, in traverse()
712 &dir_stack->list->st, ctx ); in traverse()
717 if ( (dir_stack->list->st.st_mode & S_IFMT) == S_IFDIR ) { in traverse()
719 next_dir = dir_stack; in traverse()
720 dir_stack = ber_memalloc_x( sizeof(*dir_stack), ctx ); in traverse()
721 if ( dir_stack == NULL ) { in traverse()
722 dir_stack = next_dir; in traverse()
725 dir_stack->list = NULL; in traverse()
726 dir_stack->next = next_dir; in traverse()
728 dir_stack->next->list->name, &dir_stack->list, ctx ); in traverse()
732 dir_stack->next->list->name ); in traverse()
740 dir_stack->list->name, &dir_stack->list->st, ctx ); in traverse()
745 next_name = dir_stack->list->next; in traverse()
746 ber_memfree_x( dir_stack->list->name, ctx ); in traverse()
747 ber_memfree_x( dir_stack->list, ctx ); in traverse()
748 dir_stack->list = next_name; in traverse()
752 next_dir = dir_stack->next; in traverse()
753 ber_memfree_x( dir_stack, ctx ); in traverse()
754 dir_stack = next_dir; in traverse()
755 if ( dir_stack != NULL ) { in traverse()
758 cb_rc = cb->post_func( cb->post_private, dir_stack->list->name, in traverse()
759 &dir_stack->list->st, ctx ); in traverse()
764 next_name = dir_stack->list->next; in traverse()
765 ber_memfree_x( dir_stack->list->name, ctx ); in traverse()
766 ber_memfree_x( dir_stack->list, ctx ); in traverse()
767 dir_stack->list = next_name; in traverse()
792 while ( dir_stack != NULL ) { in traverse()
793 free_name_list( dir_stack->list, ctx ); in traverse()
794 next_dir = dir_stack->next; in traverse()
795 ber_memfree_x( dir_stack, ctx ); in traverse()
796 dir_stack = next_dir; in traverse()