Subversion Repositories Kolibri OS

Rev

Rev 3731 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;---------------------------------------------------------------------
  2. get_icon_number:
  3.     mov   ebp,[extension_size]  ;[icons_end_tag]
  4.     test  ebp,ebp
  5.     jz    .end
  6.     call  normalize_extension_of_file
  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
  13.     mov   esi,extension_temp_storage
  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. ;---------------------------------------------------------------------
  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. ;---------------------------------------------------------------------
  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     ;Leency
  79. .1:
  80.        
  81.     ; mov   [extension_start],esi     ;Leency: do not get file assoc
  82.     ; call  search_star_and_end_tags  ;from KFM.INI, use /sys/@open
  83.     ; cmp   ebp,-1
  84.     ; je          .end
  85.     ; call  normalize_extension_of_file
  86. ; .search_association:
  87.     ; cmp   [end_tag],edi
  88.     ; jbe   .end
  89.     ; mov   esi,extension_temp_storage
  90.     ; mov   ecx,[extension_size]
  91.     ; inc   edi
  92.     ; cld
  93.     ; push   edi
  94.     ; rep  cmpsb
  95.     ; pop    edi
  96.     ; jne   .search_association
  97.     ; push  esi
  98.     ; mov   esi,edi
  99.     ; add   esi,[extension_size] ;4
  100.     ; cmp   [esi],byte ' '
  101.     ; je          @f
  102.     ; pop   esi
  103.     ; jmp   .search_association
  104. ; @@:
  105.     ; add   esp,4
  106.     ; inc   esi
  107.     ; mov   edi,file_name  ;start_file_data.name
  108.     ; xor   eax,eax
  109. ; @@:
  110.     ; cld
  111.     ; lodsb
  112.     ; stosb
  113.     ; cmp    al,' '
  114.     ; cmp   al,13
  115.     ; jnz   @b
  116.     ; mov   [edi-1],byte 0 ;'#'
  117.     ; cmp   [use_patch],0
  118.     ; je          @f
  119.     ; mov   [use_patch],0
  120.  
  121. .run_sysopen:
  122. @@:
  123.     cmp   [select_panel_counter],0
  124.     jne   @f
  125.     mov   esi,read_folder_name      ;read_folder.name
  126.     jmp   .start
  127. @@:
  128.     mov   esi,read_folder_1_name    ;read_folder_1.name
  129. .start:
  130.     mov   edi,start_parameter
  131.     cmp   [open_param],0
  132.     je    .start_1
  133.     mov   eax,[open_param]
  134.     mov   eax,[eax]
  135.     cld
  136.     stosd
  137. ;    call draw_window
  138. ;    mov   eax,0
  139. ;    ret
  140. .start_1:
  141.     xor   eax,eax
  142. @@:
  143.     cld
  144.     lodsb
  145.     stosb
  146.     test  eax,eax
  147.     jnz   @b
  148.     mov   [edi-1], byte '/'
  149.     mov   esi,edx
  150.     mov   [error_pointer],edx  ;start_file_data.name
  151. @@:
  152.     cld
  153.     lodsb
  154.     stosb
  155.     test  eax,eax
  156.     jnz   @b
  157. .continue:
  158.     mov   [start_file_data.param],start_parameter
  159.     ;call  start_appl ;Leency
  160.         mcall 70,sysopen  ;Leency
  161.     cmp   eax,0
  162.     jge   @f
  163.     mov  ebx,0
  164.     sub  ebx,eax
  165.     mov  eax,ebx
  166.     call start_error_window_thread
  167. @@:
  168.     mov   eax,0
  169.     ret
  170. .end:
  171.     mov   eax,1
  172.     ret
  173. ;---------------------------------------------------------------------
  174. search_star_and_end_tags:
  175.     mov   edi,[ini_file_start]
  176.     dec   edi
  177. .search_tag1:
  178.     cmp   [left_folder_data],edi
  179.     jbe  .end
  180.     mov   esi,ebp
  181.     mov   ecx,22
  182.     inc   edi
  183.     cld
  184.     push   edi
  185.     rep  cmpsb
  186.     pop    edi
  187.     jne     .search_tag1
  188.     dec    edi
  189.     push   edi
  190. .search_end_tag:
  191.     cmp   [left_folder_data],edi
  192.     jbe  .end
  193.     mov   esi,end_section_tag
  194.     mov   ecx,7
  195.     inc   edi
  196.     cld
  197.     push   edi
  198.     rep  cmpsb
  199.     pop    edi
  200.     jne     .search_end_tag
  201.     mov   [end_tag],edi
  202.     pop   edi
  203.     ret
  204. .end:
  205.     mov   ebp,-1
  206.     ret
  207. ;---------------------------------------------------------------------