MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / dir_aff_ncurses

Function dir_aff_ncurses

src/dirn.c:105–610  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105static long int dir_aff_ncurses(disk_t *disk, const partition_t *partition, dir_data_t *dir_data, file_info_t*dir_list, const unsigned long int inode, const unsigned int depth)
106{
107 /* Return value
108 * -1: quit
109 * 1: back
110 * other: new inode
111 * */
112 int quit=0;
113 int ask_destination=1;
114 WINDOW *window=(WINDOW*)dir_data->display;
115 const char *needle=NULL;
116 do
117 {
118 int offset=0;
119 int pos_num=0;
120 struct td_list_head *pos=dir_list->list.next;
121 const int old_LINES=LINES;
122 unsigned int status=FILE_STATUS_MARKED;
123 aff_copy(window);
124 wmove(window,3,0);
125 aff_part(window, AFF_PART_ORDER|AFF_PART_STATUS, disk, partition);
126 wmove(window,4,0);
127 wprintw(window,"Directory %s\n",dir_data->current_directory);
128 do
129 {
130 int i;
131 int car;
132 struct td_list_head *file_walker = NULL;
133 for(i=0, file_walker=dir_list->list.next;
134 file_walker!=&dir_list->list && i<offset;
135 file_walker=file_walker->next,i++);
136 for(i=offset;
137 file_walker!=&dir_list->list && (i-offset)<INTER_DIR;
138 file_walker=file_walker->next,i++)
139 {
140 const file_info_t *current_file=td_list_entry_const(file_walker, const file_info_t, list);
141 char str[11];
142 char datestr[80];
143 wmove(window, 6+i-offset, 0);
144 wclrtoeol(window); /* before addstr for BSD compatibility */
145 if(&current_file->list==pos)
146 {
147 wattrset(window, A_REVERSE);
148 waddstr(window, ">");
149 }
150 else if((current_file->status&FILE_STATUS_MARKED)!=0)
151 waddstr(window, "*");
152 else
153 waddstr(window, " ");
154 if(has_colors())
155 {
156 if((current_file->status&FILE_STATUS_MARKED)!=0)
157 wbkgdset(window,' ' | COLOR_PAIR(2));
158 else if((current_file->status&FILE_STATUS_DELETED)!=0)
159 wbkgdset(window,' ' | COLOR_PAIR(1));
160 }
161 set_datestr((char *)&datestr, sizeof(datestr), current_file->td_mtime);
162 mode_string(current_file->st_mode, str);

Callers 1

dir_partition_auxFunction · 0.85

Calls 12

aff_partFunction · 0.85
set_datestrFunction · 0.85
mode_stringFunction · 0.85
td_list_emptyFunction · 0.85
copy_dirFunction · 0.85
copy_progressFunction · 0.85
copy_doneFunction · 0.85
copy_selectionFunction · 0.85
ask_string_ncursesFunction · 0.85
strcasestrFunction · 0.85
aff_copyFunction · 0.70
td_list_for_eachFunction · 0.70

Tested by

no test coverage detected