-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsort.c
More file actions
79 lines (66 loc) · 2.1 KB
/
Copy pathsort.c
File metadata and controls
79 lines (66 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/***************************************************************************
*
* Umschalten des Sortierkriteriums
*
***************************************************************************/
#include "zfile.h"
void GetKindOfSort(void)
{
int c;
int s;
int order;
order = SORT_ASC; s=0;
ClearHelp();
PrintOptions( stdscr, LINES - 2, 1,
"Sort by (A)ccTime (C)hgTime (E)xtension (G)roup (M)odTime (O)rder: [ascending]"
);
PrintOptions( stdscr, LINES - 1, 2, " (N)ame o(W)ner (S)ize" );
RefreshWindow( stdscr );
doupdate();
do
{
c = Getch();
if(c == -1 || c == ESC)
return;
c = toupper(c);
if (c == 'Q')
return;
switch( c )
{
case 'N': s = SORT_BY_NAME;
break;
case 'E': s = SORT_BY_EXTENSION;
break;
case 'M': s = SORT_BY_MOD_TIME;
break;
case 'A': s = SORT_BY_ACC_TIME;
break;
case 'C': s = SORT_BY_CHG_TIME;
break;
case 'G': s = SORT_BY_GROUP;
break;
case 'W': s = SORT_BY_OWNER;
break;
case 'S': s = SORT_BY_SIZE;
break;
case 'O': if (order == SORT_ASC)
{
PrintOptions( stdscr, LINES - 2, 58, "[descending]" );
order = SORT_DSC;
}
else
{
PrintOptions( stdscr, LINES - 2, 58, "[ascending] " );
order = SORT_ASC;
}
RefreshWindow( stdscr );
doupdate();
break;
default : beep();
RefreshWindow( stdscr );
doupdate();
break;
}
} while( ! strchr("ACEGMNWS", c));
SetKindOfSort(s + order);
}