forked from KolibriOS/kolibrios
update macros @use_library
git-svn-id: svn://kolibrios.org@8219 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -1,7 +1,3 @@
|
||||
;13.03.2013 - use @notify
|
||||
;08.06.2010 - new macros @use_library_mem
|
||||
;08.05.2009 - bugfix
|
||||
;14.04.2009 - a macros for code load library the box_lib.obj from '/sys/lib/' or current dirrectory.
|
||||
; The macros for load any library/libraries:
|
||||
; Copyright (c) 2009, <Lrz>
|
||||
; All rights reserved.
|
||||
@@ -93,7 +89,7 @@
|
||||
|
||||
|
||||
|
||||
macro @use_library
|
||||
macro @use_library mem_alloc,mem_free,mem_realloc,dll_load
|
||||
{
|
||||
local lp1
|
||||
local lp2
|
||||
@@ -103,7 +99,10 @@ local lp5
|
||||
local lp6
|
||||
local file_name
|
||||
|
||||
library_fun_memory_alloc equ 0 ;<3B><> <20>ᯮ<EFBFBD>짮<EFBFBD><ECA7AE><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA2><EFBFBD><EFBFBD> <20><> <20>㭪樨 'lib_init'
|
||||
library_fun_memory_alloc equ mem_alloc
|
||||
library_fun_memory_free equ mem_free
|
||||
library_fun_memory_realloc equ mem_realloc
|
||||
library_fun_dll_load equ dll_load
|
||||
|
||||
align 4
|
||||
arrea_xx dd 0
|
||||
@@ -245,11 +244,7 @@ align 4
|
||||
|
||||
macro @use_library_mem mem_alloc,mem_free,mem_realloc,dll_load
|
||||
{
|
||||
@use_library
|
||||
library_fun_memory_alloc equ mem_alloc
|
||||
library_fun_memory_free equ mem_free
|
||||
library_fun_memory_realloc equ mem_realloc
|
||||
library_fun_dll_load equ dll_load
|
||||
@use_library mem_alloc,mem_free,mem_realloc,dll_load
|
||||
}
|
||||
|
||||
macro sys_load_library library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, myimport, err_message_import__, head_f_i__,point_dir_name__
|
||||
@@ -263,10 +258,10 @@ local i_exit
|
||||
jnz i_begin
|
||||
|
||||
if point_dir_name__ eq
|
||||
copy_path library_name__, cur_dir_path__, library_path__,0
|
||||
copy_path library_name__, [32], library_path__,0
|
||||
else
|
||||
;the macros making way /current path a program/ + name system library
|
||||
copy_path library_name__, cur_dir_path__, library_path__,point_dir_name__
|
||||
copy_path library_name__, [32], library_path__,point_dir_name__
|
||||
end if
|
||||
mcall 68,19,library_path__ ; load of alternative
|
||||
test eax,eax
|
||||
@@ -297,10 +292,10 @@ local i_error
|
||||
local i_exit
|
||||
|
||||
if point_dir_name__ eq
|
||||
copy_path library_name__, cur_dir_path__, library_path__,0
|
||||
copy_path library_name__, [32], library_path__,0
|
||||
else
|
||||
;the macros making way /current path a program/ + name system library
|
||||
copy_path library_name__, cur_dir_path__, library_path__,point_dir_name__
|
||||
copy_path library_name__, [32], library_path__,point_dir_name__
|
||||
end if
|
||||
mcall 68,19,library_path__ ; load of alternative
|
||||
test eax,eax
|
||||
@@ -341,17 +336,16 @@ local cycle1n
|
||||
local cycle1e
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
library_name__ equ [ebp]
|
||||
cur_dir_path__ equ [ebp+4]
|
||||
library_path__ equ [ebp+8]
|
||||
system_path__ equ [ebp+12]
|
||||
err_message_found_lib__ equ [ebp+16]
|
||||
head_f_l__ equ [ebp+20]
|
||||
my_import equ [ebp+24]
|
||||
err_message_import__ equ [ebp+28]
|
||||
head_f_i__ equ [ebp+32]
|
||||
point_dir_name__ equ [ebp+36]
|
||||
adr_load_lib equ dword [ebp+40]
|
||||
status_lib equ dword [ebp+44]
|
||||
library_path__ equ [ebp+4]
|
||||
system_path__ equ [ebp+8]
|
||||
err_message_found_lib__ equ [ebp+12]
|
||||
head_f_l__ equ [ebp+16]
|
||||
my_import equ [ebp+20]
|
||||
err_message_import__ equ [ebp+24]
|
||||
head_f_i__ equ [ebp+28]
|
||||
point_dir_name__ equ [ebp+32]
|
||||
adr_load_lib equ dword [ebp+36]
|
||||
status_lib equ dword [ebp+40]
|
||||
|
||||
mov ebp,_start
|
||||
mov ecx,(_end-_start)/ll_struc_size
|
||||
@@ -363,7 +357,7 @@ align 4
|
||||
jnz end_steep
|
||||
|
||||
;the macros making way /current path a program/ + name system library
|
||||
copy_path library_name__, cur_dir_path__, library_path__,point_dir_name__
|
||||
copy_path library_name__, [32], library_path__,point_dir_name__
|
||||
|
||||
mcall 68,19,library_path__ ; load of alternative
|
||||
test eax,eax
|
||||
@@ -425,17 +419,16 @@ local cycle1n
|
||||
local cycle1e
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
library_name__ equ [ebp]
|
||||
cur_dir_path__ equ [ebp+4]
|
||||
library_path__ equ [ebp+8]
|
||||
system_path__ equ [ebp+12]
|
||||
err_message_found_lib__ equ [ebp+16]
|
||||
head_f_l__ equ [ebp+20]
|
||||
my_import equ [ebp+24]
|
||||
err_message_import__ equ [ebp+28]
|
||||
head_f_i__ equ [ebp+32]
|
||||
point_dir_name__ equ [ebp+36]
|
||||
adr_load_lib equ dword [ebp+40]
|
||||
status_lib equ dword [ebp+44]
|
||||
library_path__ equ [ebp+4]
|
||||
system_path__ equ [ebp+8]
|
||||
err_message_found_lib__ equ [ebp+12]
|
||||
head_f_l__ equ [ebp+16]
|
||||
my_import equ [ebp+20]
|
||||
err_message_import__ equ [ebp+24]
|
||||
head_f_i__ equ [ebp+28]
|
||||
point_dir_name__ equ [ebp+32]
|
||||
adr_load_lib equ dword [ebp+36]
|
||||
status_lib equ dword [ebp+40]
|
||||
|
||||
mov ebp,_start
|
||||
mov ecx,(_end-_start)/ll_struc_size
|
||||
@@ -444,7 +437,7 @@ align 4
|
||||
push ecx
|
||||
|
||||
;the macros making way /current path a program/ + name system library
|
||||
copy_path library_name__, cur_dir_path__, library_path__,point_dir_name__
|
||||
copy_path library_name__, [32], library_path__,point_dir_name__
|
||||
|
||||
mcall 68,19,library_path__ ; load of alternative
|
||||
test eax,eax
|
||||
@@ -573,7 +566,7 @@ import_found:
|
||||
mov [esi-4], eax ;<3B><><EFBFBD><EFBFBD><EFBFBD>㥬 㪠<><E3AAA0>⥫<EFBFBD> (<28><> <20>㭪<EFBFBD><E3ADAA><EFBFBD>) <20> <20>ணࠬ<E0AEA3><E0A0AC>, -4 <20>⠢<EFBFBD><E2A0A2> <20><>⮬<EFBFBD> <20><><EFBFBD> esi <20>뫮 ᤢ<><E1A4A2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> lodsd
|
||||
pop edx ;<3B><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> edx <20><> <20><>砫<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>㭪権
|
||||
;--- <20><EFBFBD><E0AEA2>塞 ᮢ<><E1AEA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20><>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD> <20>㭪樨 <20> 'lib_init'
|
||||
if library_fun_memory_alloc eq 0
|
||||
if library_fun_memory_alloc eq
|
||||
else
|
||||
cmp dword[ebx],'lib_'
|
||||
jne import_loop
|
||||
@@ -602,11 +595,10 @@ exit:
|
||||
}
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
ll_struc_size = 48;($-library_name__) ; constant size of struct
|
||||
ll_struc_size = 44;($-library_name__) ; constant size of struct
|
||||
struc l_libs library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, my_import, err_message_import__, head_f_i__,point_dir_name; struct for loading libraries
|
||||
{
|
||||
.library_name__ dd library_name__ ; <20><><EFBFBD> <20><><EFBFBD><EFBFBD>㦠<EFBFBD><E3A6A0><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD>
|
||||
.cur_dir_path__ dd cur_dir_path__ ; 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> ᮤ<>ন<EFBFBD><E0A6A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20>㤠 <20>뫠 <20><><EFBFBD><EFBFBD>饭<EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|
||||
|
||||
.library_path__ dd library_path__ ; 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> <20>㤥<EFBFBD> <20><><EFBFBD><EFBFBD>ਬ<EFBFBD><EFBFBD><E0AEA2> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD>, <20> <20>㦭<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E1ABA8> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>᪠ <20>ணࠬ<E0AEA3><E0A0AC>, <20><><EFBFBD>筮 <20>㦭<EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20> <20><><EFBFBD><EFBFBD> <20><>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ⮩ <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
.complete_path dd system_path__ ; <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>⪮ ᮤ<>ন<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
Reference in New Issue
Block a user