Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 7971 → Rev 7972

/programs/cmm/TWB/anchors.h
7,7 → 7,7
int get_pos_by_name();
void clear();
void take_anchor_from();
} anchors;
} anchors=0;
 
void _anchors::add(dword _name, _pos)
{
/programs/cmm/TWB/parse_tag.h
12,7 → 12,7
bool parse_params();
bool get_next_param();
dword get_value_of();
} tag;
} tag=0;
 
bool _tag::is(dword _text)
{
/programs/cmm/browser/cache.h
4,12 → 4,12
dword current_page_buf;
dword current_page_size;
collection url;
collection data; //it has to be int
collection size; //it has to be int
collection_int data;
collection_int size;
void add();
bool has();
void clear();
} pages_cache;
} pages_cache=0;
 
void PAGES_CACHE::add(dword _url, _data, _size)
{
16,10 → 16,10
dword data_pointer;
data_pointer = malloc(_size);
memmov(data_pointer, _data, _size);
data.add(itoa(data_pointer));
data.add(data_pointer);
 
url.add(_url);
size.add(itoa(_size));
size.add(_size);
}
 
bool PAGES_CACHE::has(dword _link)
27,8 → 27,8
int pos;
pos = url.get_pos_by_name(_link);
if (pos != -1) {
current_page_buf = atoi(data.get(pos));
current_page_size = atoi(size.get(pos));
current_page_buf = data.get(pos);
current_page_size = size.get(pos);
return true;
}
return false;
/programs/cmm/browser/tabs.h
7,8 → 7,8
 
#define TABS_MAX 5
 
TWebBrowser data[TABS_MAX+1];
_history tabstory[TABS_MAX+1];
TWebBrowser data[TABS_MAX+1]=0;
_history tabstory[TABS_MAX+1]=0;
 
struct TAB
{
/programs/cmm/browser/texts.h
1,4 → 1,4
char version[]="WebView 2.6";
char version[]="WebView 2.61";
 
#ifdef LANG_RUS
char page_not_found[] = FROM "html\\page_not_found_ru.htm""\0";
/programs/cmm/drvinst/drvinst.c
58,7 → 58,7
#define WINDOW_STEP_DRIVER_LIST 2;
char window_step = WINDOW_STEP_INTRO;
 
collection ini_sections;
collection ini_sections=0;
 
char drvinf_path[4096] = "/kolibrios/drivers/drvinf.ini";
char cur_version[64];
/programs/cmm/eolite/Eolite.c
89,7 → 89,7
byte list_full_redraw;
 
dword buf;
dword file_mas[6898];
collection_int items=0;
int selected_count;
int count_dir;
 
585,7 → 585,7
char status_bar_str[80];
int go_up_folder_exists=0;
if (!show_status_bar.checked) return;
if (files.count>0) && (strcmp(file_mas[0]*304+buf+72,"..")==0) go_up_folder_exists=1;
if (files.count>0) && (streq(items.get(0)*304+buf+72,"..")) go_up_folder_exists=1;
DrawBar(0, Form.cheight - status_bar_h, Form.cwidth, status_bar_h, sc.work);
sprintf(#status_bar_str, T_STATUS_EVEMENTS, count_dir-go_up_folder_exists, files.count-count_dir);
WriteText(6,Form.cheight - 13,0x80,sc.work_text,#status_bar_str);
721,7 → 721,7
if (colored_lines.checked) && (bgcol!=col.selec) && (filenum%2) bgcol=col.odd_line;
DrawBar(files.x+icon_size+4,y,files.w-icon_size-4,files.item_h,bgcol);
 
file_offet = file_mas[filenum+files.first]*304 + buf+32;
file_offet = items.get(filenum+files.first)*304 + buf+32;
attr = ESDWORD[file_offet];
file.selected = ESBYTE[file_offet+7];
file.sizelo = ESDWORD[file_offet+32];
806,8 → 806,6
Write_Error(errornum);
return;
}
maxcount = sizeof(file_mas)/sizeof(dword)-1;
if (files.count>maxcount) files.count = maxcount;
if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0;
}
if (files.count!=-1)
835,11 → 833,14
{
dword d=0, f=1;
int j=0;
dword tmp;
dword file_off;
 
items.drop();
 
if (!strcmp(#path,"/")) //do not sort root folder
{
for(d=1;d<files.count;d++;) file_mas[d]=d;
for(d=1;d<files.count;d++;) items.set(d, d);
count_dir = d;
return;
}
848,12 → 849,12
if (dir_at_fat16) && (file_name_is_8_3(file_off+40)) strttl(file_off+40);
if (TestBit(ESDWORD[file_off],4)) //directory?
{
file_mas[d]=j;
items.set(d, j);
d++;
}
else
{
file_mas[files.count-f]=j;
items.set(files.count-f, j);
f++;
}
}
865,12 → 866,14
else if (sort_type==3) Sort_by_Size(d,files.count-1);
//reversed sorting
if (sort_desc) {
for (j=0; j<f/2; j++) file_mas[files.count-j-1]><file_mas[d+j];
//if (sort_type==1) for (j=0; j<d/2; j++) file_mas[d-j]><file_mas[j];
for (j=0; j<f/2; j++) {
items.swap(files.count-j-1, d+j);
}
//if (sort_type==1) for (j=0; j<d/2; j++) items[d-j]><items[j];
}
//make ".." first item in list
if (d>0) && (strncmp(file_mas[0]*304+buf+72,"..",2)!=0)
for(d--; d>0; d--;) if (!strncmp(file_mas[d]*304+buf+72,"..",2)) {file_mas[d]><file_mas[0]; break;}
if (d>0) && (strncmp(items.get(0)*304+buf+72,"..",2)!=0)
for(d--; d>0; d--;) if (!strncmp(items.get(d)*304+buf+72,"..",2)) {items.swap(d,0); break;}
}
 
 
913,7 → 916,7
files.KeyHome();
Open_Dir(#path,ONLY_OPEN);
if (dir_at_fat16) && (file_name_is_8_3(that_file)) strttl(that_file);
for (ind=files.count-1; ind>=0; ind--;) { if (!strcmp(file_mas[ind]*304+buf+72,that_file)) break; }
for (ind=files.count-1; ind>=0; ind--;) { if (streq(items.get(ind)*304+buf+72,that_file)) break; }
files.cur_y = ind - 1;
files.KeyDown();
DrawStatusBar();
1150,7 → 1153,7
int i;
for (i=files.cur_y+1; i<files.count; i++)
{
strcpy(#temp, file_mas[i]*304+buf+72);
strcpy(#temp, items.get(i)*304+buf+72);
if (temp[0]==key_ascii) || (temp[0]==key_ascii-32)
{
files.cur_y = i - 1;
/programs/cmm/eolite/include/breadcrumbs.h
17,7 → 17,7
}
 
void DrawBreadCrumbs()
collection_int breadCrumb;
collection_int breadCrumb=0;
char PathShow_path[4096];
block btn;
int i;
/programs/cmm/eolite/include/copy_and_delete.h
6,9 → 6,9
//===================================================//
 
void setElementSelectedFlag(dword n, int state) {
dword selected_offset = file_mas[n]*304 + buf+32 + 7;
dword selected_offset = items.get(n)*304 + buf+32 + 7;
ESBYTE[selected_offset] = state;
if (n==0) && (strncmp(file_mas[n]*304+buf+72,"..",2)==0) {
if (n==0) && (strncmp(items.get(n)*304+buf+72,"..",2)==0) {
ESBYTE[selected_offset] = false; //do not selec ".." directory
return;
}
18,7 → 18,7
}
 
int getElementSelectedFlag(dword n) {
dword selected_offset = file_mas[n]*304 + buf+32 + 7;
dword selected_offset = items.get(n)*304 + buf+32 + 7;
return ESBYTE[selected_offset];
}
 
71,7 → 71,7
for (i=0; i<files.count; i++)
{
if (getElementSelectedFlag(i) == true) {
sprintf(#copy_t,"%s/%s",#path,file_mas[i]*304+buf+72);
sprintf(#copy_t,"%s/%s",#path,items.get(i)*304+buf+72);
path_len = strlen(#copy_t);
size_buf += path_len + 1;
}
85,7 → 85,7
for (i=0; i<files.count; i++)
{
if (getElementSelectedFlag(i) == true) {
sprintf(copy_buf_offset,"%s/%s",#path,file_mas[i]*304+buf+72);
sprintf(copy_buf_offset,"%s/%s",#path,items.get(i)*304+buf+72);
copy_buf_offset += strlen(copy_buf_offset) + 1;
}
}
216,7 → 216,7
for (i=0; i<files.count; i++)
{
if (getElementSelectedFlag(i) == true) {
sprintf(#del_from,"%s/%s",#path,file_mas[i]*304+buf+72);
sprintf(#del_from,"%s/%s",#path,items.get(i)*304+buf+72);
copy_bar.max += GetFilesCount(#del_from);
}
}
226,7 → 226,7
for (i=0; i<files.count; i++)
{
if (getElementSelectedFlag(i) == true) {
sprintf(#del_from,"%s/%s", #path, file_mas[i]*304+buf+72);
sprintf(#del_from,"%s/%s", #path, items.get(i)*304+buf+72);
Del_File2(#del_from, 1);
}
}
/programs/cmm/eolite/include/left_panel.h
44,7 → 44,7
void Get();
void Draw();
void Click();
} SystemDiscs;
} SystemDiscs=0;
 
 
void GetDiskIconAndName(char disk_first_letter, dword dev_icon, disc_name)
/programs/cmm/eolite/include/properties.h
115,7 → 115,7
{
if (getElementSelectedFlag(i) == true)
{
sprintf(#pcur_file,"%s/%s",#path,file_mas[i]*304+buf+72);
sprintf(#pcur_file,"%s/%s",#path,items.get(i)*304+buf+72);
SetPropertiesFile(#pcur_file, #file_info_general);
if (SET_PROPERTIES_ALL_SUBFOLDER == mode) {
if (dir_exists(#pcur_file)) SetPropertiesDir(#pcur_file);
157,8 → 157,8
{
if (getElementSelectedFlag(i) == true)
{
sprintf(#cur_file,"%s/%s",way,file_mas[i]*304+buf+72);
if (TestBit(ESDWORD[file_mas[i]*304+buf+32], 4) )
sprintf(#cur_file,"%s/%s",way,items.get(i)*304+buf+72);
if (TestBit(ESDWORD[items.get(i)*304+buf+32], 4) )
{
more_files_count.calculate_loop(#cur_file);
more_files_count.folders++;
/programs/cmm/eolite/include/sorting.h
3,9 → 3,13
{
int j;
int iss = a;
int size1, size2;
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++;}
size2 = items.get(b)*304 + buf+64;
for (j = a; j <= b; j++) {
size1 = items.get(j)*304 + buf+64;
if (ESDWORD[size1] <= ESDWORD[size2]) { items.swap(iss,j); iss++;}
}
Sort_by_Size (a, iss-2);
Sort_by_Size (iss, b);
}
15,9 → 19,10
{
int j;
int isn = a;
dword name2 = items.get(b)*304 + buf+72;
if (a >= b) return;
for (j = a; j <= b; j++) {
if (strcmpi(file_mas[j]*304 + buf+72, file_mas[b]*304 + buf+72)<=0) { file_mas[isn] >< file_mas[j]; isn++;}
if (strcmpi(items.get(j)*304 + buf+72, name2)<=0) { items.swap(isn,j); isn++;}
}
Sort_by_Name(a, isn-2);
Sort_by_Name(isn, b);
30,10 → 35,10
dword filename1, filename2, ext1, ext2;
int n, isn = a;
if (a >= b) return;
filename2 = items.get(b)*304 + buf+72;
for (j = a; j <= b; j++)
{
filename1 = file_mas[j]*304 + buf+72;
filename2 = file_mas[b]*304 + buf+72;
filename1 = items.get(j)*304 + buf+72;
 
n=strlen(filename1)-1;
WHILE (n>0) && (ESBYTE[filename1+n]!='.') n--;
44,8 → 49,8
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++;}
if (n<0) { items.swap(isn, j); isn++;}
if (!n) && (strcmp(filename1, filename2) <= 0) { items.swap(isn,j); isn++;}
}
Sort_by_Type(a, isn-2);
Sort_by_Type(isn, b);
/programs/cmm/eolite/include/translations.h
1,5 → 1,5
#define TITLE "Eolite File Manager 4.28b"
#define ABOUT_TITLE "EOLITE 4.28b"
#define TITLE "Eolite File Manager 4.3"
#define ABOUT_TITLE "EOLITE 4.3"
 
#ifdef LANG_RUS
?define T_FILE "” ©«"
/programs/cmm/examples/collections.c
7,13 → 7,43
void main()
{
io.run("/sys/develop/board", "");
test1();
test2();
test_int();
test_str();
ExitProcess();
}
 
void test1()
collection s;
void test_int()
collection_int ci=0;
int i;
{
ci.add(0);
ci.add(1);
ci.add(2);
ci.add(3);
debugln("-> 0 1 2 3");
for (i=0; i<ci.count; i++) debugln(itoa(ci.get(i)));
ci.pop();
ci.pop();
ci.add(4);
debugln("-> 0 1 4");
for (i=0; i<ci.count; i++) debugln(itoa(ci.get(i)));
ci.set(1,9);
debugln("-> 0 9 4");
for (i=0; i<ci.count; i++) debugln(itoa(ci.get(i)));
 
ci.set(6,6);
debugln("-> 0 9 4 0 0 0 6");
for (i=0; i<ci.count; i++) debugln(itoa(ci.get(i)));
 
ci.swap(0,2);
debugln("-> 4 9 0 0 0 0 6");
for (i=0; i<ci.count; i++) debugln(itoa(ci.get(i)));
}
 
void test_str()
collection s=0;
{
s.add("Hello");
s.add("World");
debugln(s.get(0)); //-> Hello
26,21 → 56,3
debugln(s.get(1)); //-> Kolibri
s.drop();
}
 
void test2()
collection_int ci;
int i;
{
ci.add(0);
ci.add(1);
ci.add(2);
ci.add(3);
debugln("-> 0 1 2 3");
for (i=0; i<ci.count; i++) debugln(itoa(ci.get(i))); //-> 0 1 2 3
ci.count--;
ci.count--;
ci.add(4);
debugln("-> 0 1 4");
for (i=0; i<ci.count; i++) debugln(itoa(ci.get(i))); //-> 0 1 4
ci.drop();
}
/programs/cmm/lib/array.h
41,7 → 41,7
:byte Array::init(dword size)
{
dword pointer = 0;
if (!size) size = 8;
if (!size) size = 240;
IF(!memory)
{
lenInitSize = size * 17;
/programs/cmm/lib/collection.h
2,8 → 2,86
#define INCLUDE_COLLECTION_H
#print "[include <collection.h>]\n"
 
#include "array.h"
 
/*========================================================
= =
= Integer =
= =
========================================================*/
 
struct collection_int
{
dword buf;
dword buf_size;
unsigned count;
void alloc();
void add();
dword get();
void set();
void swap();
dword len();
dword get_last();
void pop();
void drop();
};
 
:void collection_int::alloc() {
if (!buf) {
buf_size = 4096;
buf = malloc(4096);
} else {
buf_size += 4096;
buf = realloc(buf, buf_size);
}
}
 
:void collection_int::add(dword _in) {
if (!buf) || (count * sizeof(dword) >= buf_size) alloc();
EAX = count * sizeof(dword) + buf;
ESDWORD[EAX] = _in;
count++;
}
 
:dword collection_int::get(dword pos) {
if (pos<0) || (pos>=count) return 0;
return ESDWORD[pos * sizeof(dword) + buf];
}
 
 
:void collection_int::set(dword pos, _in) {
while (pos >= count) add(0);
EAX = pos * sizeof(dword) + buf;
ESDWORD[EAX] = _in;
}
 
:void collection_int::swap(dword pos1, pos2) {
while (pos1 >= count) add(0);
while (pos2 >= count) add(0);
EAX = pos1 * sizeof(dword) + buf;
EBX = pos2 * sizeof(dword) + buf;
ESDWORD[EAX] >< ESDWORD[EBX];
}
 
:dword collection_int::len(dword pos) {
if (pos<0) || (pos+1>=count) return 0;
return get(pos+1) - get(pos);
}
 
:dword collection_int::get_last() {
return get(count-1);
}
 
:void collection_int::pop() {
if (count>0) count--;
}
 
:void collection_int::drop() {
count = 0;
}
 
/*========================================================
= =
= String =
= =
========================================================*/
13,7 → 91,7
int realloc_size, count;
dword data_start;
dword data_size;
dword element_offset[4000];
collection_int offset;
int add();
int addn();
dword get(); //get_name_by_pos
42,24 → 120,20
}
 
:int collection::addn(dword in, len) {
if (count >= 4000) {
debugln("collection: more than 4000 elements!");
return 0;
}
if (element_offset[count]+len+2 > data_size) {
if (offset.get(count)+len+2 > data_size) {
increase_data_size();
addn(in, len);
return 1;
}
strncpy(data_start+element_offset[count], in, len);
strncpy(data_start+offset.get(count), in, len);
count++;
element_offset[count] = element_offset[count-1] + len + 1;
offset.set(count, offset.get(count-1) + len + 1);
return 1;
}
 
:dword collection::get(dword pos) {
if (pos<0) || (pos>=count) return 0;
return data_start + element_offset[pos];
return data_start + offset.get(pos);
}
 
:dword collection::get_last() {
69,7 → 143,7
:dword collection::get_pos_by_name(dword name) {
dword i;
for (i=0; i<count; i++) {
if (strcmp(data_start + element_offset[i], name)==0) return i;
if (strcmp(data_start + offset.get(i), name)==0) return i;
}
return -1;
}
78,7 → 152,7
if (data_start) free(data_start);
data_size = 0;
data_start = 0;
element_offset[count] = 0;
offset.drop();
count = 0;
}
 
86,63 → 160,4
if (count>0) count--;
}
 
/*========================================================
= =
= Integer =
= =
========================================================*/
 
struct collection_int
{
dword buf;
dword buf_size;
unsigned count;
void alloc();
void add();
dword get();
dword len();
dword get_last();
void pop();
void drop();
};
 
:void collection_int::alloc() {
if (!buf) {
buf_size = 4096;
buf = malloc(4096);
} else {
buf_size += 4096;
buf = realloc(buf, buf_size);
}
}
 
:void collection_int::add(dword _in) {
if (!buf) || (count * sizeof(dword) >= buf_size) alloc();
EAX = count * sizeof(dword) + buf;
ESDWORD[EAX] = _in;
count++;
}
 
:dword collection_int::get(dword pos) {
if (pos<0) || (pos>=count) return 0;
return ESDWORD[pos * sizeof(dword) + buf];
}
 
:dword collection_int::len(dword pos) {
if (pos<0) || (pos+1>=count) return 0;
return get(pos+1) - get(pos);
}
 
:dword collection_int::get_last() {
return get(count-1);
}
 
:void collection_int::pop() {
if (count>0) count--;
}
 
:void collection_int::drop() {
count = 0;
}
 
#endif
/programs/cmm/menu/menu.c
10,8 → 10,8
#define SEP_H 4
 
llist menu1;
collection names;
collection hotkeys;
collection names=0;
collection hotkeys=0;
 
int selected, win_x, win_y;
 
/programs/cmm/misc/calypte.c
116,7 → 116,7
scroll_bar scroll_v = { SCROLL_SIZE,200,398,44,0,2,115,15,0,0xeeeeee,0xBBBbbb,0xeeeeee,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1};
scroll_bar scroll_h = { SCROLL_SIZE,200,398,44,0,2,115,15,0,0xeeeeee,0xBBBbbb,0xeeeeee,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1};
 
collection s;
collection s=0;
 
//===================================================//
// //
/programs/cmm/misc/software_widget.c
17,7 → 17,7
 
proc_info Form;
llist list;
collection app_path_collection;
collection app_path_collection=0;
bool kolibrios_mounted;
 
int window_width,
/programs/cmm/taskbar2/taskbar2.c
26,7 → 26,7
 
int current_process_id = 0;
int proc_list[256];
collection attached;
collection attached=0;
 
llist list;