kolibrios/programs/cmm/eolite/include/sorting.h
Kirill Lipatov (Leency) 2ec87d22f7 C-- app updates
WebView 1.8b: 
- key scroll by up and down lists 12 pixels instead of 1
- open app with param when href="" contains '|' symbol, example: href="/sys/tmpdisk|a0"
Eolite 3.96b: 
- fix sorting
- an option to highlight odd lines
- copy path to clipboard by clicking on path bar
- rewrite the code related to device an folder update: so this change removed unnecessary refreshes
- add refresh when /kolibrios mounted
IconEdit 0.57b:
- improve color gradient block
- press Delete key when smth selected fill selection by color2 and resents selection
- impove window appearance when the dark skin is set
- fix a stupid but issue which made impossible to open non-square images
- fix an issue that wrong zoom number displayed
Notes 0.8: 
- reworking, work in progress
- delete binary
Sysmon 0.87:
- minor visible improvement in progress bars
TmpDisk 0.67a:
- deny users to shoot in the foot: show forbid message on /tmp0 deletion

git-svn-id: svn://kolibrios.org@7422 a494cfbc-eb01-0410-851d-a64ba20cac60
2018-10-01 16:41:14 +00:00

55 lines
1.5 KiB
C

void Sort_by_Size(int a, b) // äëÿ ïåðâîãî âûçîâà: a = 0, b = <ýëåìåíòîâ â ìàññèâå> - 1
{
int j;
int iss = a;
if (a >= b) return;
for (j = a; j <= b; j++)
if (ESDWORD[file_mas[j]*304 + buf+64] <= ESDWORD[file_mas[b]*304 + buf+64]) { file_mas[iss] >< file_mas[j]; iss++;}
Sort_by_Size (a, iss-2);
Sort_by_Size (iss, b);
}
void Sort_by_Name(int a, b) // äëÿ ïåðâîãî âûçîâà: a = 0, b = <ýëåìåíòîâ â ìàññèâå> - 1
{
int j;
int isn = a;
if (a >= b) return;
for (j = a; j <= b; j++)
if (strcmp(file_mas[j]*304 + buf+72, file_mas[b]*304 + buf+72)<=0) { file_mas[isn] >< file_mas[j]; isn++;}
Sort_by_Name(a, isn-2);
Sort_by_Name(isn, b);
}
void Sort_by_Type(int a, b) // äëÿ ïåðâîãî âûçîâà: a = 0, b = <ýëåìåíòîâ â ìàññèâå> - 1
{
int j;
dword filename1, filename2, ext1, ext2;
int n, isn = a;
if (a >= b) return;
for (j = a; j <= b; j++)
{
filename1 = file_mas[j]*304 + buf+72;
filename2 = file_mas[b]*304 + buf+72;
n=strlen(filename1)-1;
WHILE (n>0) && (ESBYTE[filename1+n]!='.') n--;
if (n) ext1 = filename1+n+1; else ext1=0;
n=strlen(filename2);
n--;
WHILE (n>0) && (ESBYTE[filename2+n]!='.') n--;
if (n) ext2 = filename2+n+1; else ext2=0;
n=strcmp(ext1, ext2);
if (n<0) { file_mas[isn] >< file_mas[j]; isn++;}
if (!n) && (strcmp(filename1, filename2)<=0) { file_mas[isn] >< file_mas[j]; isn++;}
}
Sort_by_Type(a, isn-2);
Sort_by_Type(isn, b);
}