ktcc: removed old COFF library wrappers.
git-svn-id: svn://kolibrios.org@9548 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
e0e11ba32b
commit
e0891b157c
@ -1,10 +0,0 @@
|
|||||||
all:
|
|
||||||
fasm boxlib.asm
|
|
||||||
ar -crs libbox.a boxlib.o
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.a
|
|
||||||
rm -f *.o
|
|
||||||
|
|
||||||
install:
|
|
||||||
mv libbox.a ../../bin/lib
|
|
@ -1,230 +0,0 @@
|
|||||||
; writed by maxcodehack
|
|
||||||
; adaptation of clayer for ktcc
|
|
||||||
format elf
|
|
||||||
use32 ; Tell compiler to use 32 bit instructions
|
|
||||||
; ELF section
|
|
||||||
section '.text' executable
|
|
||||||
|
|
||||||
|
|
||||||
include '../../../../../proc32.inc'
|
|
||||||
include '../../../../../macros.inc'
|
|
||||||
purge section,mov,add,sub
|
|
||||||
|
|
||||||
include '../../../../../dll.inc'
|
|
||||||
|
|
||||||
|
|
||||||
public init_boxlib as 'kolibri_boxlib_init'
|
|
||||||
|
|
||||||
proc init_boxlib
|
|
||||||
local retval dd ?
|
|
||||||
mov [retval], eax
|
|
||||||
pusha
|
|
||||||
mcall 68, 11
|
|
||||||
test eax, eax
|
|
||||||
jnz @f
|
|
||||||
mov [retval], -1
|
|
||||||
jmp exit_init_boxlib
|
|
||||||
@@:
|
|
||||||
stdcall dll.Load, @IMPORT
|
|
||||||
test eax, eax
|
|
||||||
jz exit_init_boxlib
|
|
||||||
mov [retval], -1
|
|
||||||
exit_init_boxlib:
|
|
||||||
popa
|
|
||||||
mov eax, [retval]
|
|
||||||
ret
|
|
||||||
endp
|
|
||||||
|
|
||||||
;; Wrapper to handle edit_box_key function for editboxes.
|
|
||||||
;; Call this baby from C (refer kolibri_editbox.h for details)
|
|
||||||
public editbox_key_thunk as 'edit_box_key' ; renamed due to ambiguity
|
|
||||||
;; replaced by siemargl as inline ASM in C wrapper
|
|
||||||
editbox_key_thunk:
|
|
||||||
mov eax, [esp+8]
|
|
||||||
mov [oldebp], ebp ;Save ebp because GCC is crazy for it otherwise.
|
|
||||||
pop ebp ;Save return address in ebp. Stack top is param now.
|
|
||||||
;mov eax, dword [press_key]
|
|
||||||
call [edit_box_key] ; The pointer we passed should be on the stack already.
|
|
||||||
push ebp ;push the return address back to stack
|
|
||||||
mov ebp, [oldebp]
|
|
||||||
ret
|
|
||||||
oldebp dd ?
|
|
||||||
|
|
||||||
section '.data' writeable
|
|
||||||
|
|
||||||
@IMPORT:
|
|
||||||
library lib_boxlib, 'box_lib.obj'
|
|
||||||
|
|
||||||
import lib_boxlib, \
|
|
||||||
edit_box_draw, 'edit_box' , \
|
|
||||||
edit_box_key, 'edit_box_key' , \
|
|
||||||
edit_box_mouse, 'edit_box_mouse', \
|
|
||||||
edit_box_set_text, 'edit_box_set_text' , \
|
|
||||||
init_checkbox2, 'init_checkbox2' , \
|
|
||||||
check_box_draw2, 'check_box_draw2' , \
|
|
||||||
check_box_mouse2, 'check_box_mouse2' , \
|
|
||||||
option_box_draw, 'option_box_draw' , \
|
|
||||||
option_box_mouse, 'option_box_mouse' , \
|
|
||||||
scrollbar_v_draw, 'scrollbar_v_draw' , \
|
|
||||||
scrollbar_v_mouse, 'scrollbar_v_mouse' , \
|
|
||||||
scrollbar_h_draw, 'scrollbar_h_draw' , \
|
|
||||||
scrollbar_h_mouse, 'scrollbar_h_mouse' , \
|
|
||||||
dynamic_button_draw, 'dbutton_draw' , \
|
|
||||||
dynamic_button_mouse, 'dbutton_mouse' , \
|
|
||||||
menu_bar_draw, 'menu_bar_draw' , \
|
|
||||||
menu_bar_mouse, 'menu_bar_mouse' , \
|
|
||||||
menu_bar_activate, 'menu_bar_activate' , \
|
|
||||||
fb_draw_panel, 'FileBrowser_draw' , \
|
|
||||||
fb_mouse, 'FileBrowser_mouse' , \
|
|
||||||
fb_key, 'FileBrowser_key' , \
|
|
||||||
tl_data_init, 'tl_data_init' , \
|
|
||||||
tl_data_clear, 'tl_data_clear' , \
|
|
||||||
tl_info_clear, 'tl_info_clear' , \
|
|
||||||
tl_key, 'tl_key' , \
|
|
||||||
tl_mouse, 'tl_mouse' , \
|
|
||||||
tl_draw, 'tl_draw' , \
|
|
||||||
tl_info_undo, 'tl_info_undo' , \
|
|
||||||
tl_info_redo, 'tl_info_redo' , \
|
|
||||||
tl_node_add, 'tl_node_add' , \
|
|
||||||
tl_node_set_data, 'tl_node_set_data' , \
|
|
||||||
tl_node_get_data, 'tl_node_get_data' , \
|
|
||||||
tl_node_delete, 'tl_node_delete' , \
|
|
||||||
tl_cur_beg, 'tl_cur_beg' , \
|
|
||||||
tl_cur_next, 'tl_cur_next' , \
|
|
||||||
tl_cur_perv, 'tl_cur_perv' , \
|
|
||||||
tl_node_close_open, 'tl_node_close_open' , \
|
|
||||||
tl_node_lev_inc, 'tl_node_lev_inc' , \
|
|
||||||
tl_node_lev_dec, 'tl_node_lev_dec' , \
|
|
||||||
tl_node_move_up, 'tl_node_move_up' , \
|
|
||||||
tl_node_move_down, 'tl_node_move_down' , \
|
|
||||||
tl_node_poi_get_info, 'tl_node_poi_get_info' , \
|
|
||||||
tl_node_poi_get_next_info, 'tl_node_poi_get_next_info' , \
|
|
||||||
tl_node_poi_get_data, 'tl_node_poi_get_data' , \
|
|
||||||
tl_save_mem, 'tl_save_mem' , \
|
|
||||||
tl_load_mem, 'tl_load_mem' , \
|
|
||||||
tl_get_mem_size, 'tl_get_mem_size' , \
|
|
||||||
path_show_prepare, 'PathShow_prepare' , \
|
|
||||||
path_show_draw, 'PathShow_draw' , \
|
|
||||||
ted_but_sumb_upper, 'ted_but_sumb_upper' , \
|
|
||||||
ted_but_sumb_lover, 'ted_but_sumb_lover' , \
|
|
||||||
ted_but_convert_by_table, 'ted_but_convert_by_table' , \
|
|
||||||
ted_can_save, 'ted_can_save' , \
|
|
||||||
ted_clear, 'ted_clear' , \
|
|
||||||
ted_delete, 'ted_delete' , \
|
|
||||||
ted_draw, 'ted_draw' , \
|
|
||||||
ted_init, 'ted_init' , \
|
|
||||||
ted_init_scroll_bars, 'ted_init_scroll_bars' , \
|
|
||||||
ted_init_syntax_file, 'ted_init_syntax_file' , \
|
|
||||||
ted_is_select, 'ted_is_select' , \
|
|
||||||
ted_key, 'ted_key' , \
|
|
||||||
ted_mouse, 'ted_mouse' , \
|
|
||||||
ted_open_file, 'ted_open_file' , \
|
|
||||||
ted_save_file, 'ted_save_file' , \
|
|
||||||
ted_text_add, 'ted_text_add' , \
|
|
||||||
ted_but_select_word, 'ted_but_select_word' , \
|
|
||||||
ted_but_cut, 'ted_but_cut' , \
|
|
||||||
ted_but_copy, 'ted_but_copy' , \
|
|
||||||
ted_but_paste, 'ted_but_paste' , \
|
|
||||||
ted_but_undo, 'ted_but_undo' , \
|
|
||||||
ted_but_redo, 'ted_but_redo' , \
|
|
||||||
ted_but_reverse, 'ted_but_reverse' , \
|
|
||||||
ted_but_find, 'ted_but_find' , \
|
|
||||||
ted_but_replace, 'ted_but_replace' , \
|
|
||||||
ted_text_colored, 'ted_text_colored' , \
|
|
||||||
ted_go_to_position, 'ted_go_to_position' , \
|
|
||||||
frame_draw, 'frame_draw' , \
|
|
||||||
progressbar_draw,'progressbar_draw' , \
|
|
||||||
progressbar_progress, 'progressbar_progress'
|
|
||||||
|
|
||||||
|
|
||||||
public edit_box_draw as 'edit_box_draw'
|
|
||||||
;public edit_box_key as 'edit_box_key'
|
|
||||||
|
|
||||||
public edit_box_mouse as 'edit_box_mouse'
|
|
||||||
public edit_box_set_text as 'edit_box_set_text'
|
|
||||||
|
|
||||||
public check_box_draw2 as 'check_box_draw2'
|
|
||||||
public check_box_mouse2 as 'check_box_mouse2'
|
|
||||||
public init_checkbox2 as 'init_checkbox2'
|
|
||||||
|
|
||||||
public progressbar_draw as 'progressbar_draw'
|
|
||||||
public progressbar_progress as 'progressbar_progress'
|
|
||||||
|
|
||||||
public frame_draw as 'frame_draw'
|
|
||||||
|
|
||||||
public scrollbar_v_draw as 'scrollbar_v_draw'
|
|
||||||
public scrollbar_v_mouse as 'scrollbar_v_mouse'
|
|
||||||
public scrollbar_h_draw as 'scrollbar_h_draw'
|
|
||||||
public scrollbar_h_mouse as 'scrollbar_h_mouse'
|
|
||||||
|
|
||||||
public option_box_draw as 'option_box_draw'
|
|
||||||
public option_box_mouse as 'option_box_mouse'
|
|
||||||
|
|
||||||
public menu_bar_draw as 'menu_bar_draw'
|
|
||||||
public menu_bar_mouse as 'menu_bar_mouse'
|
|
||||||
public menu_bar_activate as 'menu_bar_activate'
|
|
||||||
|
|
||||||
public dynamic_button_draw as 'dynamic_button_draw'
|
|
||||||
public dynamic_button_mouse as 'dynamic_button_mouse'
|
|
||||||
|
|
||||||
public path_show_prepare as 'path_show_prepare'
|
|
||||||
public path_show_draw as 'path_show_draw'
|
|
||||||
|
|
||||||
public fb_draw_panel as 'filebrowse_draw'
|
|
||||||
public fb_mouse as 'filebrowse_mouse'
|
|
||||||
public fb_key as 'filebrowse_key'
|
|
||||||
|
|
||||||
public ted_but_sumb_upper as 'ted_but_sumb_upper'
|
|
||||||
public ted_but_sumb_lover as 'ted_but_sumb_lover'
|
|
||||||
public ted_but_convert_by_table as 'ted_but_convert_by_table'
|
|
||||||
public ted_can_save as 'ted_can_save'
|
|
||||||
public ted_clear as 'ted_clear'
|
|
||||||
public ted_delete as 'ted_delete'
|
|
||||||
public ted_draw as 'ted_draw'
|
|
||||||
public ted_init as 'ted_init'
|
|
||||||
public ted_init_scroll_bars as 'ted_init_scroll_bars'
|
|
||||||
public ted_init_syntax_file as 'ted_init_syntax_file'
|
|
||||||
public ted_is_select as 'ted_is_select'
|
|
||||||
public ted_key as 'ted_key_asm'
|
|
||||||
public ted_mouse as 'ted_mouse'
|
|
||||||
public ted_open_file as 'ted_open_file_asm'
|
|
||||||
public ted_save_file as 'ted_save_file_asm'
|
|
||||||
public ted_text_add as '_ted_text_add'
|
|
||||||
public ted_but_select_word as 'ted_but_select_word'
|
|
||||||
public ted_but_cut as 'ted_but_cut'
|
|
||||||
public ted_but_copy as 'ted_but_copy'
|
|
||||||
public ted_but_paste as 'ted_but_paste'
|
|
||||||
public ted_but_undo as 'ted_but_undo'
|
|
||||||
public ted_but_redo as 'ted_but_redo'
|
|
||||||
public ted_but_reverse as 'ted_but_reverse'
|
|
||||||
public ted_but_find as 'ted_but_find'
|
|
||||||
public ted_but_replace as 'ted_but_replace'
|
|
||||||
public ted_text_colored as 'ted_text_colored_asm'
|
|
||||||
public ted_go_to_position as 'ted_go_to_position'
|
|
||||||
|
|
||||||
public tl_data_init as 'tl_data_init'
|
|
||||||
public tl_data_clear as 'tl_data_clear'
|
|
||||||
public tl_info_clear as 'tl_info_clear'
|
|
||||||
public tl_key as 'tl_key_asm'
|
|
||||||
public tl_mouse as 'tl_mouse'
|
|
||||||
public tl_draw as 'tl_draw'
|
|
||||||
public tl_info_undo as 'tl_info_undo'
|
|
||||||
public tl_info_redo as 'tl_info_redo'
|
|
||||||
public tl_node_add as 'tl_node_add'
|
|
||||||
public tl_node_set_data as 'tl_node_set_data'
|
|
||||||
public tl_node_get_data as 'tl_node_get_data'
|
|
||||||
public tl_node_delete as 'tl_node_delete'
|
|
||||||
public tl_cur_beg as 'tl_cur_beg'
|
|
||||||
public tl_cur_next as 'tl_cur_next'
|
|
||||||
public tl_cur_perv as 'tl_cur_perv'
|
|
||||||
public tl_node_close_open as 'tl_node_close_open'
|
|
||||||
public tl_node_lev_inc as 'tl_node_lev_inc'
|
|
||||||
public tl_node_lev_dec as 'tl_node_lev_dec'
|
|
||||||
public tl_node_move_up as 'tl_node_move_up'
|
|
||||||
public tl_node_move_down as 'tl_node_move_down'
|
|
||||||
public tl_node_poi_get_info as 'tl_node_poi_get_info'
|
|
||||||
public tl_node_poi_get_next_info as 'tl_node_poi_get_next_info'
|
|
||||||
public tl_node_poi_get_data as 'tl_node_poi_get_data'
|
|
||||||
public tl_save_mem as 'tl_save_mem_asm'
|
|
||||||
public tl_load_mem as 'tl_load_mem_asm'
|
|
||||||
public tl_get_mem_size as 'tl_get_mem_size_asm'
|
|
@ -1,10 +0,0 @@
|
|||||||
all:
|
|
||||||
fasm buf2d.asm buf2d.o
|
|
||||||
ar -csr libbuf2d.a buf2d.o
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.a
|
|
||||||
rm -f *.o
|
|
||||||
|
|
||||||
install:
|
|
||||||
mv *.a ../../bin/lib
|
|
@ -1,90 +0,0 @@
|
|||||||
format elf
|
|
||||||
use32 ; Tell compiler to use 32 bit instructions
|
|
||||||
|
|
||||||
section '.text' executable
|
|
||||||
|
|
||||||
include '../../../../../proc32.inc'
|
|
||||||
include '../../../../../macros.inc'
|
|
||||||
purge section,mov,add,sub
|
|
||||||
|
|
||||||
include '../../../../../dll.inc'
|
|
||||||
|
|
||||||
;public lib_init as 'kolibri_buf2d_init'
|
|
||||||
;;; Returns 0 on success. -1 on failure.
|
|
||||||
public init_buf2d as 'kolibri_buf2d_init'
|
|
||||||
|
|
||||||
proc init_buf2d
|
|
||||||
pusha
|
|
||||||
mcall 68,11
|
|
||||||
stdcall dll.Load, @IMPORT
|
|
||||||
popa
|
|
||||||
ret
|
|
||||||
endp
|
|
||||||
|
|
||||||
section '.data' writeable
|
|
||||||
|
|
||||||
@IMPORT:
|
|
||||||
library lib_buf2d, 'buf2d.obj'
|
|
||||||
|
|
||||||
import lib_buf2d, \
|
|
||||||
libbuf2d_init, 'lib_init' , \
|
|
||||||
buf2d_create, 'buf2d_create' , \
|
|
||||||
buf2d_clear, 'buf2d_clear' , \
|
|
||||||
buf2d_draw, 'buf2d_draw' , \
|
|
||||||
buf2d_delete, 'buf2d_delete', \
|
|
||||||
buf2d_rotate, 'buf2d_rotate', \
|
|
||||||
buf2d_resize, 'buf2d_resize', \
|
|
||||||
buf2d_line, 'buf2d_line', \
|
|
||||||
buf2d_line_sm, 'buf2d_line_sm', \
|
|
||||||
buf2d_rect_by_size, 'buf2d_rect_by_size', \
|
|
||||||
buf2d_filled_rect_by_size, 'buf2d_filled_rect_by_size', \
|
|
||||||
buf2d_circle, 'buf2d_circle', \
|
|
||||||
buf2d_img_hdiv2, 'buf2d_img_hdiv2', \
|
|
||||||
buf2d_img_wdiv2, 'buf2d_img_wdiv2', \
|
|
||||||
buf2d_conv_24_to_8, 'buf2d_conv_24_to_8', \
|
|
||||||
buf2d_conv_24_to_32, 'buf2d_conv_24_to_32', \
|
|
||||||
buf2d_bit_blt, 'buf2d_bit_blt', \
|
|
||||||
buf2d_bit_blt_transp, 'buf2d_bit_blt_transp', \
|
|
||||||
buf2d_bit_blt_alpha, 'buf2d_bit_blt_alpha', \
|
|
||||||
buf2d_curve_bezier, 'buf2d_curve_bezier', \
|
|
||||||
buf2d_convert_text_matrix, 'buf2d_convert_text_matrix', \
|
|
||||||
buf2d_draw_text, 'buf2d_draw_text', \
|
|
||||||
buf2d_crop_color, 'buf2d_crop_color', \
|
|
||||||
buf2d_offset_h, 'buf2d_offset_h', \
|
|
||||||
buf2d_flood_fill, 'buf2d_flood_fill', \
|
|
||||||
buf2d_set_pixel, 'buf2d_set_pixel', \
|
|
||||||
buf2d_get_pixel, 'buf2d_get_pixel', \
|
|
||||||
buf2d_flip_h, 'buf2d_flip_h', \
|
|
||||||
buf2d_flip_v, 'buf2d_flip_v', \
|
|
||||||
buf2d_filter_dither, 'buf2d_filter_dither'
|
|
||||||
|
|
||||||
public libbuf2d_init as 'libimg_init'
|
|
||||||
public buf2d_create as 'buf2d_create_asm'
|
|
||||||
public buf2d_clear as 'buf2d_clear'
|
|
||||||
public buf2d_draw as 'buf2d_draw'
|
|
||||||
public buf2d_delete as 'buf2d_delete'
|
|
||||||
public buf2d_rotate as 'buf2d_rotate'
|
|
||||||
public buf2d_resize as 'buf2d_resize'
|
|
||||||
public buf2d_line as 'buf2d_line'
|
|
||||||
public buf2d_line_sm as 'buf2d_line_sm'
|
|
||||||
public buf2d_rect_by_size as 'buf2d_rect_by_size'
|
|
||||||
public buf2d_filled_rect_by_size as 'buf2d_filled_rect_by_size'
|
|
||||||
public buf2d_circle as 'buf2d_circle'
|
|
||||||
public buf2d_img_hdiv2 as 'buf2d_img_hdiv2'
|
|
||||||
public buf2d_img_wdiv2 as 'buf2d_img_wdiv2'
|
|
||||||
public buf2d_conv_24_to_8 as 'buf2d_conv_24_to_8'
|
|
||||||
public buf2d_conv_24_to_32 as 'buf2d_conv_24_to_32'
|
|
||||||
public buf2d_bit_blt as 'buf2d_bit_blt'
|
|
||||||
public buf2d_bit_blt_transp as 'buf2d_bit_blt_transp'
|
|
||||||
public buf2d_bit_blt_alpha as 'buf2d_bit_blt_alpha'
|
|
||||||
public buf2d_curve_bezier as 'buf2d_curve_bezier_asm'
|
|
||||||
public buf2d_convert_text_matrix as 'buf2d_convert_text_matrix'
|
|
||||||
public buf2d_draw_text as 'buf2d_draw_text'
|
|
||||||
public buf2d_crop_color as 'buf2d_crop_color'
|
|
||||||
public buf2d_offset_h as 'buf2d_offset_h'
|
|
||||||
public buf2d_flood_fill as 'buf2d_flood_fill'
|
|
||||||
public buf2d_set_pixel as 'buf2d_set_pixel'
|
|
||||||
public buf2d_get_pixel as 'buf2d_get_pixel'
|
|
||||||
public buf2d_flip_h as 'buf2d_flip_h'
|
|
||||||
public buf2d_flip_v as 'buf2d_flip_v'
|
|
||||||
public buf2d_filter_dither as 'buf2d_filter_dither'
|
|
@ -1,11 +0,0 @@
|
|||||||
FASM = fasm
|
|
||||||
|
|
||||||
OBJS = get.o head.o __lib__.o post.o receive.o send.o free.o
|
|
||||||
|
|
||||||
%.o : %.asm
|
|
||||||
$(FASM) $<
|
|
||||||
|
|
||||||
all: $(OBJS)
|
|
||||||
ar -rsc libhttp.a *.o
|
|
||||||
mv -f libhttp.a ../../bin/lib
|
|
||||||
rm -f *.o
|
|
@ -1,9 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include '__lib__.inc'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
public lib_name
|
|
||||||
|
|
||||||
lib_name db 0x55, 0xAA, lib_name_str, 0
|
|
@ -1,2 +0,0 @@
|
|||||||
lib_name equ @http.obj
|
|
||||||
lib_name_str equ '/sys/lib/http.obj'
|
|
@ -1,18 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include "__lib__.inc"
|
|
||||||
|
|
||||||
fun equ http_free
|
|
||||||
fun_str equ 'free'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
fun_name db fun_str, 0
|
|
||||||
|
|
||||||
section '.data'
|
|
||||||
|
|
||||||
extrn lib_name
|
|
||||||
public fun
|
|
||||||
|
|
||||||
fun dd fun_name
|
|
||||||
lib dd lib_name
|
|
@ -1,18 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include "__lib__.inc"
|
|
||||||
|
|
||||||
fun equ http_get
|
|
||||||
fun_str equ 'get'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
fun_name db fun_str, 0
|
|
||||||
|
|
||||||
section '.data'
|
|
||||||
|
|
||||||
extrn lib_name
|
|
||||||
public fun
|
|
||||||
|
|
||||||
fun dd fun_name
|
|
||||||
lib dd lib_name
|
|
@ -1,18 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include "__lib__.inc"
|
|
||||||
|
|
||||||
fun equ http_head
|
|
||||||
fun_str equ 'head'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
fun_name db fun_str, 0
|
|
||||||
|
|
||||||
section '.data'
|
|
||||||
|
|
||||||
extrn lib_name
|
|
||||||
public fun
|
|
||||||
|
|
||||||
fun dd fun_name
|
|
||||||
lib dd lib_name
|
|
@ -1,18 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include "__lib__.inc"
|
|
||||||
|
|
||||||
fun equ http_post
|
|
||||||
fun_str equ 'post'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
fun_name db fun_str, 0
|
|
||||||
|
|
||||||
section '.data'
|
|
||||||
|
|
||||||
extrn lib_name
|
|
||||||
public fun
|
|
||||||
|
|
||||||
fun dd fun_name
|
|
||||||
lib dd lib_name
|
|
@ -1,18 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include "__lib__.inc"
|
|
||||||
|
|
||||||
fun equ http_receive
|
|
||||||
fun_str equ 'receive'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
fun_name db fun_str, 0
|
|
||||||
|
|
||||||
section '.data'
|
|
||||||
|
|
||||||
extrn lib_name
|
|
||||||
public fun
|
|
||||||
|
|
||||||
fun dd fun_name
|
|
||||||
lib dd lib_name
|
|
@ -1,18 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include "__lib__.inc"
|
|
||||||
|
|
||||||
fun equ http_send
|
|
||||||
fun_str equ 'send'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
fun_name db fun_str, 0
|
|
||||||
|
|
||||||
section '.data'
|
|
||||||
|
|
||||||
extrn lib_name
|
|
||||||
public fun
|
|
||||||
|
|
||||||
fun dd fun_name
|
|
||||||
lib dd lib_name
|
|
@ -1,18 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include "__lib__.inc"
|
|
||||||
|
|
||||||
fun equ InputBox
|
|
||||||
fun_str equ 'InputBox'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
fun_name db fun_str, 0
|
|
||||||
|
|
||||||
section '.data'
|
|
||||||
|
|
||||||
extrn lib_name
|
|
||||||
public fun
|
|
||||||
|
|
||||||
fun dd fun_name
|
|
||||||
lib dd lib_name
|
|
@ -1,9 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include '__lib__.inc'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
public lib_name
|
|
||||||
|
|
||||||
lib_name db 0x55, 0xAA, lib_name_str, 0
|
|
@ -1,2 +0,0 @@
|
|||||||
lib_name equ @inputbox.obj
|
|
||||||
lib_name_str equ '/sys/lib/inputbox.obj'
|
|
@ -1,5 +0,0 @@
|
|||||||
fasm __lib__.asm
|
|
||||||
fasm InputBox.asm
|
|
||||||
kos32-ar -ru libinputbox.a *.o
|
|
||||||
del *.o
|
|
||||||
pause
|
|
@ -1,9 +0,0 @@
|
|||||||
all:
|
|
||||||
fasm loadlibimg.asm
|
|
||||||
ar -csr libimg.a loadlibimg.o
|
|
||||||
|
|
||||||
install:
|
|
||||||
mv libimg.a ../../bin/lib/libimg.a
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o *.a
|
|
@ -1,88 +0,0 @@
|
|||||||
format elf
|
|
||||||
use32 ; Tell compiler to use 32 bit instructions
|
|
||||||
|
|
||||||
; ELF section
|
|
||||||
section '.text' executable
|
|
||||||
|
|
||||||
|
|
||||||
include '../../../../../proc32.inc'
|
|
||||||
include '../../../../../macros.inc'
|
|
||||||
purge section,mov,add,sub
|
|
||||||
|
|
||||||
include '../../../../../dll.inc'
|
|
||||||
|
|
||||||
|
|
||||||
public init_libimg as 'kolibri_libimg_init'
|
|
||||||
;;; Returns 0 on success. -1 on failure.
|
|
||||||
|
|
||||||
proc init_libimg
|
|
||||||
local retval dd ?
|
|
||||||
mov [retval], eax
|
|
||||||
pusha
|
|
||||||
mcall 68, 11
|
|
||||||
test eax, eax
|
|
||||||
jnz @f
|
|
||||||
mov [retval], -1
|
|
||||||
jmp exit_init_libimg
|
|
||||||
@@:
|
|
||||||
stdcall dll.Load, @IMPORT
|
|
||||||
test eax, eax
|
|
||||||
jz exit_init_libimg
|
|
||||||
mov [retval], -1
|
|
||||||
exit_init_libimg:
|
|
||||||
popa
|
|
||||||
mov eax, [retval]
|
|
||||||
ret
|
|
||||||
endp
|
|
||||||
|
|
||||||
; ELF section
|
|
||||||
section '.data' writeable
|
|
||||||
|
|
||||||
@IMPORT:
|
|
||||||
library lib_libimg, 'libimg.obj'
|
|
||||||
|
|
||||||
import lib_libimg, \
|
|
||||||
libimg_init, 'lib_init' , \
|
|
||||||
img_is_img, 'img_is_img' , \
|
|
||||||
img_info, 'img_info' , \
|
|
||||||
img_from_file, 'img_from_file', \
|
|
||||||
img_to_file, 'img_to_file', \
|
|
||||||
img_from_rgb, 'img_from_rgb', \
|
|
||||||
img_to_rgb, 'img_to_rgb', \
|
|
||||||
img_to_rgb2, 'img_to_rgb2', \
|
|
||||||
img_decode, 'img_decode', \
|
|
||||||
img_encode, 'img_encode', \
|
|
||||||
img_create, 'img_create', \
|
|
||||||
img_destroy, 'img_destroy', \
|
|
||||||
img_destroy_layer, 'img_destroy_layer', \
|
|
||||||
img_count, 'img_count', \
|
|
||||||
img_lock_bits, 'img_lock_bits', \
|
|
||||||
img_unlock_bits, 'img_unlock_bits', \
|
|
||||||
img_flip, 'img_flip', \
|
|
||||||
img_flip_layer, 'img_flip_layer', \
|
|
||||||
img_rotate, 'img_rotate', \
|
|
||||||
img_rotate_layer, 'img_rotate_layer', \
|
|
||||||
img_draw, 'img_draw', \
|
|
||||||
img_blend, 'img_blend', \
|
|
||||||
img_convert, 'img_convert', \
|
|
||||||
img_resize_data, 'img_resize_data', \
|
|
||||||
img_scale, 'img_scale'
|
|
||||||
|
|
||||||
public libimg_init as 'libimg_init'
|
|
||||||
public img_to_rgb as 'img_to_rgb'
|
|
||||||
public img_to_rgb2 as 'img_to_rgb2'
|
|
||||||
public img_decode as 'img_decode'
|
|
||||||
public img_encode as 'img_encode'
|
|
||||||
public img_create as 'img_create'
|
|
||||||
public img_destroy as 'img_destroy'
|
|
||||||
public img_destroy_layer as 'img_destroy_layer'
|
|
||||||
public img_count as 'img_count'
|
|
||||||
public img_flip as 'img_flip'
|
|
||||||
public img_flip_layer as 'img_flip_layer'
|
|
||||||
public img_rotate as 'img_rotate'
|
|
||||||
public img_rotate_layer as 'img_rotate_layer'
|
|
||||||
public img_draw as 'img_draw'
|
|
||||||
public img_blend as 'img_blend'
|
|
||||||
public img_convert as 'img_convert'
|
|
||||||
public img_resize_data as 'img_resize_data'
|
|
||||||
public img_scale as 'img_scale'
|
|
@ -1,7 +0,0 @@
|
|||||||
all:
|
|
||||||
fasm network.asm
|
|
||||||
ar -csr libnetwork.a network.o
|
|
||||||
clean:
|
|
||||||
rm -f *.o *.a
|
|
||||||
install:
|
|
||||||
cp libnetwork.a ../../bin/lib
|
|
@ -1,50 +0,0 @@
|
|||||||
format elf
|
|
||||||
use32 ; Tell compiler to use 32 bit instructions
|
|
||||||
; ELF section
|
|
||||||
section '.text' executable
|
|
||||||
|
|
||||||
|
|
||||||
include '../../../../../proc32.inc'
|
|
||||||
include '../../../../../macros.inc'
|
|
||||||
purge section,mov,add,sub
|
|
||||||
|
|
||||||
include '../../../../../dll.inc'
|
|
||||||
|
|
||||||
|
|
||||||
public lib_init as 'networklib_init'
|
|
||||||
|
|
||||||
|
|
||||||
proc lib_init
|
|
||||||
local retval dd ?
|
|
||||||
mov [retval], eax
|
|
||||||
pusha
|
|
||||||
mcall 68, 11
|
|
||||||
test eax, eax
|
|
||||||
jnz @f
|
|
||||||
mov [retval], -1
|
|
||||||
jmp exit_init_networklib
|
|
||||||
@@:
|
|
||||||
stdcall dll.Load, @IMPORT
|
|
||||||
test eax, eax
|
|
||||||
jz exit_init_networklib
|
|
||||||
mov [retval], -1
|
|
||||||
exit_init_networklib:
|
|
||||||
popa
|
|
||||||
mov eax, [retval]
|
|
||||||
ret
|
|
||||||
endp
|
|
||||||
|
|
||||||
section '.data' writeable
|
|
||||||
@IMPORT:
|
|
||||||
library networklib, 'network.obj'
|
|
||||||
|
|
||||||
import networklib, \
|
|
||||||
inet_addr, 'inet_addr', \
|
|
||||||
inet_ntoa, 'inet_ntoa', \
|
|
||||||
getaddrinfo, 'getaddrinfo', \
|
|
||||||
freeaddrinfo, 'freeaddrinfo'
|
|
||||||
|
|
||||||
public inet_addr as 'inet_addr'
|
|
||||||
public inet_ntoa as 'inet_ntoa'
|
|
||||||
public getaddrinfo as 'getaddrinfo'
|
|
||||||
public freeaddrinfo as 'freeaddrinfo'
|
|
@ -1,9 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include '__lib__.inc'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
public lib_name
|
|
||||||
|
|
||||||
lib_name db 0x55, 0xAA, lib_name_str, 0
|
|
@ -1,2 +0,0 @@
|
|||||||
lib_name equ @RASTERWORKS.OBJ
|
|
||||||
lib_name_str equ '/sys/lib/RASTERWORKS.OBJ'
|
|
@ -1,18 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include "__lib__.inc"
|
|
||||||
|
|
||||||
fun equ charsFit
|
|
||||||
fun_str equ 'charsFit'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
fun_name db fun_str, 0
|
|
||||||
|
|
||||||
section '.data'
|
|
||||||
|
|
||||||
extrn lib_name
|
|
||||||
public fun
|
|
||||||
|
|
||||||
fun dd fun_name
|
|
||||||
lib dd lib_name
|
|
@ -1,18 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include "__lib__.inc"
|
|
||||||
|
|
||||||
fun equ countUTF8Z
|
|
||||||
fun_str equ 'cntUTF-8'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
fun_name db fun_str, 0
|
|
||||||
|
|
||||||
section '.data'
|
|
||||||
|
|
||||||
extrn lib_name
|
|
||||||
public fun
|
|
||||||
|
|
||||||
fun dd fun_name
|
|
||||||
lib dd lib_name
|
|
@ -1,18 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include "__lib__.inc"
|
|
||||||
|
|
||||||
fun equ drawText
|
|
||||||
fun_str equ 'drawText'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
fun_name db fun_str, 0
|
|
||||||
|
|
||||||
section '.data'
|
|
||||||
|
|
||||||
extrn lib_name
|
|
||||||
public fun
|
|
||||||
|
|
||||||
fun dd fun_name
|
|
||||||
lib dd lib_name
|
|
@ -1,7 +0,0 @@
|
|||||||
fasm __lib__.asm
|
|
||||||
fasm mb_create.asm
|
|
||||||
fasm mb_reinit.asm
|
|
||||||
fasm mb_setfunctions.asm
|
|
||||||
kos32-ar -ru libmsgbox.a *.o
|
|
||||||
del *.o
|
|
||||||
pause
|
|
@ -1,9 +0,0 @@
|
|||||||
all:
|
|
||||||
fasm __lib__.asm
|
|
||||||
fasm charsFit.asm
|
|
||||||
fasm cntUTF-8.asm
|
|
||||||
fasm drawText.asm
|
|
||||||
fasm strWidth.asm
|
|
||||||
ar -crs librasterworks.a *.o
|
|
||||||
clean:
|
|
||||||
rm -f *.o
|
|
@ -1,18 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include "__lib__.inc"
|
|
||||||
|
|
||||||
fun equ strWidth
|
|
||||||
fun_str equ 'strWidth'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
fun_name db fun_str, 0
|
|
||||||
|
|
||||||
section '.data'
|
|
||||||
|
|
||||||
extrn lib_name
|
|
||||||
public fun
|
|
||||||
|
|
||||||
fun dd fun_name
|
|
||||||
lib dd lib_name
|
|
@ -1,9 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include '__lib__.inc'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
public lib_name
|
|
||||||
|
|
||||||
lib_name db 0x55, 0xAA, lib_name_str, 0
|
|
@ -1,2 +0,0 @@
|
|||||||
lib_name equ @msgbox.obj
|
|
||||||
lib_name_str equ '/sys/lib/msgbox.obj'
|
|
@ -1,7 +0,0 @@
|
|||||||
fasm __lib__.asm
|
|
||||||
fasm mb_create.asm
|
|
||||||
fasm mb_reinit.asm
|
|
||||||
fasm mb_setfunctions.asm
|
|
||||||
kos32-ar -ru libmsgbox.a *.o
|
|
||||||
del *.o
|
|
||||||
pause
|
|
@ -1,8 +0,0 @@
|
|||||||
all:
|
|
||||||
fasm __lib__.asm
|
|
||||||
fasm mb_create.asm
|
|
||||||
fasm mb_reinit.asm
|
|
||||||
fasm mb_setfunctions.asm
|
|
||||||
kos32-ar -ru libmsgbox.a *.o
|
|
||||||
clean:
|
|
||||||
rm -f *.o
|
|
@ -1,18 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include "__lib__.inc"
|
|
||||||
|
|
||||||
fun equ msgbox_create
|
|
||||||
fun_str equ 'mb_create'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
fun_name db fun_str, 0
|
|
||||||
|
|
||||||
section '.data'
|
|
||||||
|
|
||||||
extrn lib_name
|
|
||||||
public fun
|
|
||||||
|
|
||||||
fun dd fun_name
|
|
||||||
lib dd lib_name
|
|
@ -1,18 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include "__lib__.inc"
|
|
||||||
|
|
||||||
fun equ msgbox_reinit
|
|
||||||
fun_str equ 'mb_reinit'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
fun_name db fun_str, 0
|
|
||||||
|
|
||||||
section '.data'
|
|
||||||
|
|
||||||
extrn lib_name
|
|
||||||
public fun
|
|
||||||
|
|
||||||
fun dd fun_name
|
|
||||||
lib dd lib_name
|
|
@ -1,18 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include "__lib__.inc"
|
|
||||||
|
|
||||||
fun equ msgbox_setfunctions
|
|
||||||
fun_str equ 'mb_setfunctions'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
fun_name db fun_str, 0
|
|
||||||
|
|
||||||
section '.data'
|
|
||||||
|
|
||||||
extrn lib_name
|
|
||||||
public fun
|
|
||||||
|
|
||||||
fun dd fun_name
|
|
||||||
lib dd lib_name
|
|
@ -1,7 +0,0 @@
|
|||||||
all:
|
|
||||||
fasm loadproclib.asm
|
|
||||||
ar -csr libdialog.a loadproclib.o
|
|
||||||
install:
|
|
||||||
mv libdialog.a ../../bin/lib
|
|
||||||
clean:
|
|
||||||
rm -f *.o *.a
|
|
@ -1,39 +0,0 @@
|
|||||||
|
|
||||||
format elf
|
|
||||||
use32 ; Tell compiler to use 32 bit instructions
|
|
||||||
|
|
||||||
section '.text' executable ; Keep this line before includes or GCC messes up call addresses
|
|
||||||
|
|
||||||
include '../../../../../proc32.inc'
|
|
||||||
include '../../../../../macros.inc'
|
|
||||||
purge section,mov,add,sub
|
|
||||||
|
|
||||||
include '../../../../../dll.inc'
|
|
||||||
|
|
||||||
public init_proclib as 'kolibri_dialog_init'
|
|
||||||
;;; Returns 0 on success. -1 on failure.
|
|
||||||
|
|
||||||
proc init_proclib
|
|
||||||
pusha
|
|
||||||
mcall 68,11
|
|
||||||
stdcall dll.Load, @IMPORT
|
|
||||||
popa
|
|
||||||
ret
|
|
||||||
endp
|
|
||||||
|
|
||||||
section '.data' writeable
|
|
||||||
|
|
||||||
@IMPORT:
|
|
||||||
library lib_boxlib, 'proc_lib.obj'
|
|
||||||
|
|
||||||
import lib_boxlib, \
|
|
||||||
OpenDialog_init, 'OpenDialog_init' , \
|
|
||||||
OpenDialog_start, 'OpenDialog_start' , \
|
|
||||||
ColorDialog_init, 'ColorDialog_init' , \
|
|
||||||
ColorDialog_start, 'ColorDialog_start'
|
|
||||||
|
|
||||||
public OpenDialog_init as 'OpenDialog_init'
|
|
||||||
public OpenDialog_start as 'OpenDialog_start'
|
|
||||||
|
|
||||||
public ColorDialog_init as 'ColorDialog_init'
|
|
||||||
public ColorDialog_start as 'ColorDialog_start'
|
|
@ -1,9 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include '__lib__.inc'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
public lib_name
|
|
||||||
|
|
||||||
lib_name db 0x55, 0xAA, lib_name_str, 0
|
|
@ -1,2 +0,0 @@
|
|||||||
lib_name equ @sample.obj
|
|
||||||
lib_name_str equ '/sys/lib/sample.obj'
|
|
@ -1,13 +0,0 @@
|
|||||||
Create new library wrapper
|
|
||||||
|
|
||||||
1. Redefine lib_name and lib_name_str in __lib__.inc
|
|
||||||
2. Create file for each symbol, basing on sample_symbol.asm and for each:
|
|
||||||
2.1. Redefine fun to *your_symbol_name*
|
|
||||||
2.2. Redefine fun_name to '*your_symbol_name*' (with quotes, this is ASCII string, no trailing zero need)
|
|
||||||
3. Change make.bat as appropriate
|
|
||||||
|
|
||||||
ACHTUNG: lib_name need to be unique in project, this is why I started it with "@" and put "." into.
|
|
||||||
ACHTUNG: lib_name_str must be at least 5 symbols long, if is not, fix this adding padding to the path.
|
|
||||||
|
|
||||||
Now you can create header file and declare extern variables pointers-to-functions, and then link your app with -llibname (put .a file in lib folder).
|
|
||||||
For examples of such header files, look at include/kos/inputbox.h, include/kos/console.h and include/kos/http.h. IMO, first one is the simplest.
|
|
@ -1,5 +0,0 @@
|
|||||||
fasm __lib__.asm
|
|
||||||
fasm sample_symbol.asm
|
|
||||||
kos32-ar -ru libsample.a *.o
|
|
||||||
del *.o
|
|
||||||
pause
|
|
@ -1,18 +0,0 @@
|
|||||||
format ELF
|
|
||||||
|
|
||||||
include "__lib__.inc"
|
|
||||||
|
|
||||||
fun equ sample_symbol
|
|
||||||
fun_str equ 'sample_symbol'
|
|
||||||
|
|
||||||
section '.text'
|
|
||||||
|
|
||||||
fun_name db fun_str, 0
|
|
||||||
|
|
||||||
section '.data'
|
|
||||||
|
|
||||||
extrn lib_name
|
|
||||||
public fun
|
|
||||||
|
|
||||||
fun dd fun_name
|
|
||||||
lib dd lib_name
|
|
Loading…
Reference in New Issue
Block a user