Subversion Repositories Kolibri OS

Rev

Rev 1792 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1792 yogev_ezra 1
;---------------------------------------------------------------------
2
get_icon_number:
3
    mov   ebp,[extension_size]	;[icons_end_tag]
3731 mario79 4
    test  ebp,ebp
5
    jz    .end
6
    call  normalize_extension_of_file
1792 yogev_ezra 7
    mov   edx,[icons_end_tag]
8
    mov   edi,[ini_file_start]
9
    dec   edi
10
.search_association:
11
    cmp   edx,edi
12
    jbe   .end
3731 mario79 13
    mov   esi,extension_temp_storage
1792 yogev_ezra 14
    mov   ecx,ebp
15
    test  ecx,ecx
16
    je	  @f
17
    sub   ecx,2
18
@@:
19
    inc   edi
20
    mov   ebx,edi
21
    cld
22
    rep   cmpsb
23
    mov   edi,ebx
24
    jne   .search_association
25
    mov   esi,edi
26
    add   esi,ebp
27
    test  ebp,ebp
28
    je	  @f
29
    sub   esi,2
30
@@:
31
    cmp   [esi],byte ' '
32
    jne   .search_association
33
    inc   esi
34
    xor   ebx,ebx
35
    call  .calculate
36
    imul  eax,1000
37
    call  .calculate_1
38
    imul  eax,100
39
    call  .calculate_1
40
    imul  eax,10
41
    call  .calculate_1
42
    add   ebx,eax
43
    ret
44
.end:
45
    mov  ebx,2
46
    ret
47
;---------------------------------------------------------------------
48
.calculate_1:
49
    add   ebx,eax
50
.calculate:
51
    xor   eax,eax
52
    cld
53
    lodsb
54
    sub   eax,0x30
55
    ret
56
;---------------------------------------------------------------------
3731 mario79 57
normalize_extension_of_file:
58
    push  edi
59
    mov   esi,[extension_start]
60
    mov   edi,extension_temp_storage
61
    cld
62
@@:
63
    lodsb
64
    call  char_todown
65
    stosb
66
    test  al,al
67
    jnz   @b
68
    pop   edi
69
    ret
70
;---------------------------------------------------------------------
1792 yogev_ezra 71
open_file_with_appl_1:
72
    mov   ebp,files_associations_1
73
    jmp   open_file_with_appl.1
74
;---------------------------------------------------------------------
75
open_file_with_appl:
76
; edx - start file name
77
; esi - start extension
78
    mov   ebp,files_associations
79
.1:
80
    mov   [extension_start],esi
81
    call  search_star_and_end_tags
82
    cmp   ebp,-1
83
    je	  .end
3731 mario79 84
    call  normalize_extension_of_file
1792 yogev_ezra 85
.search_association:
86
    cmp   [end_tag],edi
87
    jbe   .end
3731 mario79 88
    mov   esi,extension_temp_storage
1792 yogev_ezra 89
    mov   ecx,[extension_size]
90
    inc   edi
91
    cld
92
    push   edi
93
    rep  cmpsb
94
    pop    edi
95
    jne   .search_association
96
    push  esi
97
    mov   esi,edi
98
    add   esi,[extension_size] ;4
99
    cmp   [esi],byte ' '
100
    je	  @f
101
    pop   esi
102
    jmp   .search_association
103
@@:
104
    add   esp,4
105
    inc   esi
106
    mov   edi,file_name  ;start_file_data.name
107
    xor   eax,eax
108
@@:
109
    cld
110
    lodsb
111
    stosb
112
    cmp    al,' '
113
    cmp   al,13
114
    jnz   @b
115
    mov   [edi-1],byte 0 ;'#'
116
    cmp   [use_patch],0
117
    je	  @f
118
    mov   [use_patch],0
119
    jmp   .continue
120
@@:
121
    cmp   [select_panel_counter],0
122
    jne   @f
123
    mov   esi,read_folder_name	    ;read_folder.name
124
    jmp   .start
125
@@:
126
    mov   esi,read_folder_1_name    ;read_folder_1.name
127
.start:
128
    mov   edi,start_parameter
129
    cmp   [open_param],0
130
    je    .start_1
131
    mov   eax,[open_param]
132
    mov   eax,[eax]
133
    cld
134
    stosd
135
;    call draw_window
136
;    mov   eax,0
137
;    ret
138
.start_1:
139
    xor   eax,eax
140
@@:
141
    cld
142
    lodsb
143
    stosb
144
    test  eax,eax
145
    jnz   @b
146
    mov   [edi-1], byte '/'
147
    mov   esi,edx
148
    mov   [error_pointer],edx  ;start_file_data.name
149
@@:
150
    cld
151
    lodsb
152
    stosb
153
    test  eax,eax
154
    jnz   @b
155
.continue:
156
    mov   [start_file_data.param],start_parameter
157
    call  start_appl
158
    cmp   eax,0
159
    jge   @f
160
    mov  ebx,0
161
    sub  ebx,eax
162
    mov  eax,ebx
163
    call start_error_window_thread
164
@@:
165
    mov   eax,0
166
    ret
167
.end:
168
    mov   eax,1
169
    ret
170
;---------------------------------------------------------------------
171
search_star_and_end_tags:
172
    mov   edi,[ini_file_start]
173
    dec   edi
174
.search_tag1:
175
    cmp   [left_folder_data],edi
176
    jbe  .end
177
    mov   esi,ebp
178
    mov   ecx,22
179
    inc   edi
180
    cld
181
    push   edi
182
    rep  cmpsb
183
    pop    edi
184
    jne     .search_tag1
185
    dec    edi
186
    push   edi
187
.search_end_tag:
188
    cmp   [left_folder_data],edi
189
    jbe  .end
190
    mov   esi,end_section_tag
191
    mov   ecx,7
192
    inc   edi
193
    cld
194
    push   edi
195
    rep  cmpsb
196
    pop    edi
197
    jne     .search_end_tag
198
    mov   [end_tag],edi
199
    pop   edi
200
    ret
201
.end:
202
    mov   ebp,-1
203
    ret
204
;---------------------------------------------------------------------