ktcc: rollback to r9529

git-svn-id: svn://kolibrios.org@9558 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
turbocat 2022-01-02 12:16:17 +00:00
parent 5c8619e65c
commit e08c6968ef
357 changed files with 17300 additions and 456 deletions

Binary file not shown.

View File

@ -1,98 +0,0 @@
LIBRARY box_lib.obj
EXPORTS
edit_box
edit_box_key
edit_box_mouse
edit_box_set_text
version_ed
init_checkbox2
check_box_draw2
check_box_mouse2
version_ch2
option_box_draw
option_box_mouse
version_op
scrollbar_v_draw
scrollbar_v_mouse
scrollbar_h_draw
scrollbar_h_mouse
version_scrollbar
dbutton_draw
dbutton_mouse
version_dbutton
menu_bar_draw
menu_bar_mouse
menu_bar_activate
version_menu_bar
FileBrowser_draw
FileBrowser_mouse
FileBrowser_key
version_FileBrowser
tl_data_init
tl_data_clear
tl_info_clear
tl_key
tl_mouse
tl_draw
tl_info_undo
tl_info_redo
tl_node_add
tl_node_set_data
tl_node_get_data
tl_node_delete
tl_cur_beg
tl_cur_next
tl_cur_perv
tl_node_close_open
tl_node_lev_inc
tl_node_lev_dec
tl_node_move_up
tl_node_move_down
tl_node_poi_get_info
tl_node_poi_get_next_info
tl_node_poi_get_data
tl_save_mem
tl_load_mem
tl_get_mem_size
version_tree_list
PathShow_prepare
PathShow_draw
version_PathShow
ted_but_sumb_upper
ted_but_sumb_lover
ted_but_convert_by_table
ted_can_save
ted_clear
ted_delete
ted_draw
ted_init
ted_init_scroll_bars
ted_init_syntax_file
ted_is_select
ted_key
ted_mouse
ted_open_file
ted_save_file
ted_text_add
ted_but_select_word
ted_but_cut
ted_but_copy
ted_but_paste
ted_but_undo
ted_but_redo
ted_but_reverse
ted_but_find
ted_but_replace
ted_text_colored
ted_go_to_position
version_text_edit
frame_draw
version_frame
progressbar_draw
progressbar_progress
tooltip_init
tooltip_delete
tooltip_test_show
tooltip_mouse
get_font_size

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +0,0 @@
LIBRARY msgbox.obj
EXPORTS
mb_create
mb_reinit
mb_setfunctions

View File

@ -1,7 +0,0 @@
LIBRARY rasterworks.obj
EXPORTS
charsFit
cntUTF-8
drawText
strWidth

Binary file not shown.

Binary file not shown.

View File

@ -2,7 +2,6 @@ LIBRARY proc_lib.obj
EXPORTS EXPORTS
ColorDialog_init ColorDialog_init
ColorDialog_start
OpenDialog_start OpenDialog_start
OpenDialog_init OpenDialog_init
OpenDialog_set_file_ext OpenDialog_set_file_ext

View File

@ -175,6 +175,3 @@ time
localtime localtime
asctime asctime
difftime difftime
;___LIBGEN___
basename
dirname

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,127 @@
;
; 2021, Edited by Coldy
;
; This module same as original crt0.asm, but cut:
; 1. virtual header block (hparams change to __app_params, hpath change to __app_path)
; 2. init heap of memory - not needed because 68.18 (68.19) init heap implicitly
; (it is does dll.obj)
; 3. loader (he lives in dll.obj)
;
format ELF
section '.text' executable
public start
public start as '_start'
extrn main
;include 'debug2.inc'
include '/../../../../../../proc32.inc'
include '/../../../../../../macros.inc'
__DEBUG__ = 0
__app_params equ 0x1C ; Pointer to program arguments
;__app_path equ 0x20 ; Pointer to program path
start:
;DEBUGF 'Start programm\n'
mov [argc], 0
mov eax, [__app_params]
test eax, eax
jz .without_path
mov eax, path
cmp word ptr eax, 32fh ; '/#3' UTF8
jne .without_path
mov word ptr eax, 12fh ; '/#1' fix to CP866
.without_path:
mov esi, eax
call push_param
; retrieving parameters
mov esi, params
xor edx, edx ; dl - èä¸ò ïàðàìåòð(1) èëè ðàçäåëèòåëè(0)
; dh - ñèìâîë ñ êîòîðîãî íà÷àëñÿ ïàðàìåòð (1 êàâû÷êè, 0 îñòàëüíîå)
mov ecx, 1 ; cl = 1
; ch = 0 ïðîñòî íîëü
.parse:
lodsb
test al, al
jz .run
test dl, dl
jnz .findendparam
;{åñëè áûë ðàçäåëèòåëü
cmp al, ' '
jz .parse ;çàãðóæåí ïðîáåë, ãðóçèì ñëåäóþùèé ñèìâîë
mov dl, cl ;íà÷èíàåòñÿ ïàðàìåòð
cmp al, '"'
jz @f ;çàãðóæåíû êàâû÷êè
mov dh, ch ;ïàðàìåòð áåç êàâû÷åê
dec esi
call push_param
inc esi
jmp .parse
@@:
mov dh, cl ;ïàðàìåòð â êàâû÷åêàõ
call push_param ;åñëè íå ïðîáåë çíà÷èò íà÷èíàåòñÿ êàêîé òî ïàðàìåòð
jmp .parse ;åñëè áûë ðàçäåëèòåëü}
.findendparam:
test dh, dh
jz @f ; áåç êàâû÷åê
cmp al, '"'
jz .clear
jmp .parse
@@:
cmp al, ' '
jnz .parse
.clear:
lea ebx, [esi - 1]
mov [ebx], ch
mov dl, ch
jmp .parse
.run:
push argv
push [argc]
call main
.exit:
xor eax,eax
dec eax
int 0x40
dd -1
.crash:
jmp .exit
;============================
push_param:
;============================
;parameters
; esi - pointer
;description
; procedure increase argc
; and add pointer to array argv
; procedure changes ebx
mov ebx, [argc]
cmp ebx, max_parameters
jae .dont_add
mov [argv+4*ebx], esi
inc [argc]
.dont_add:
ret
;==============================
public argc as '__argc'
public params as '__argv'
public path as '__path'
section '.bss'
buf_len = 0x400
max_parameters=0x20
argc rd 1
argv rd max_parameters
path rb buf_len
params rb buf_len
;section '.data'
;include_debug_strings ; ALWAYS present in data section

View File

@ -0,0 +1,18 @@
//
// This sample show that KX extension supported or not
#include <stdio.h>
int main(){
char* kx_ext =
#ifndef __KX__
"not "
#endif
"supported"
;
printf("KX extension %s", kx_ext);
return 0;
}

View File

@ -0,0 +1,3 @@
#SHS
../../../tcc ../src/tests/kxtest.c -o kxtest -I../../include -llibc
exit

View File

@ -0,0 +1,10 @@
all:
fasm boxlib.asm
ar -crs libbox.a boxlib.o
clean:
rm -f *.a
rm -f *.o
install:
mv libbox.a ../../bin/lib

View File

@ -0,0 +1,230 @@
; 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'

View File

@ -0,0 +1,10 @@
all:
fasm buf2d.asm buf2d.o
ar -csr libbuf2d.a buf2d.o
clean:
rm -f *.a
rm -f *.o
install:
mv *.a ../../bin/lib

View File

@ -0,0 +1,90 @@
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'

View File

@ -0,0 +1,11 @@
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

View File

@ -0,0 +1,9 @@
format ELF
include '__lib__.inc'
section '.text'
public lib_name
lib_name db 0x55, 0xAA, lib_name_str, 0

View File

@ -0,0 +1,2 @@
lib_name equ @http.obj
lib_name_str equ '/sys/lib/http.obj'

View File

@ -0,0 +1,18 @@
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

View File

@ -0,0 +1,18 @@
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

View File

@ -0,0 +1,18 @@
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

View File

@ -0,0 +1,18 @@
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

View File

@ -0,0 +1,18 @@
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

View File

@ -0,0 +1,18 @@
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

View File

@ -0,0 +1,18 @@
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

View File

@ -0,0 +1,9 @@
format ELF
include '__lib__.inc'
section '.text'
public lib_name
lib_name db 0x55, 0xAA, lib_name_str, 0

View File

@ -0,0 +1,2 @@
lib_name equ @inputbox.obj
lib_name_str equ '/sys/lib/inputbox.obj'

View File

@ -0,0 +1,5 @@
fasm __lib__.asm
fasm InputBox.asm
kos32-ar -ru libinputbox.a *.o
del *.o
pause

View File

@ -0,0 +1,9 @@
all:
fasm loadlibimg.asm
ar -csr libimg.a loadlibimg.o
install:
mv libimg.a ../../bin/lib/libimg.a
clean:
rm -f *.o *.a

View File

@ -0,0 +1,88 @@
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'

View File

@ -0,0 +1,7 @@
all:
fasm network.asm
ar -csr libnetwork.a network.o
clean:
rm -f *.o *.a
install:
cp libnetwork.a ../../bin/lib

View File

@ -0,0 +1,50 @@
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'

View File

@ -0,0 +1,9 @@
format ELF
include '__lib__.inc'
section '.text'
public lib_name
lib_name db 0x55, 0xAA, lib_name_str, 0

View File

@ -0,0 +1,2 @@
lib_name equ @RASTERWORKS.OBJ
lib_name_str equ '/sys/lib/RASTERWORKS.OBJ'

View File

@ -0,0 +1,18 @@
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

View File

@ -0,0 +1,18 @@
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

View File

@ -0,0 +1,18 @@
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

View File

@ -0,0 +1,7 @@
fasm __lib__.asm
fasm mb_create.asm
fasm mb_reinit.asm
fasm mb_setfunctions.asm
kos32-ar -ru libmsgbox.a *.o
del *.o
pause

View File

@ -0,0 +1,9 @@
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

View File

@ -0,0 +1,18 @@
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

View File

@ -0,0 +1,9 @@
format ELF
include '__lib__.inc'
section '.text'
public lib_name
lib_name db 0x55, 0xAA, lib_name_str, 0

View File

@ -0,0 +1,2 @@
lib_name equ @msgbox.obj
lib_name_str equ '/sys/lib/msgbox.obj'

View File

@ -0,0 +1,7 @@
fasm __lib__.asm
fasm mb_create.asm
fasm mb_reinit.asm
fasm mb_setfunctions.asm
kos32-ar -ru libmsgbox.a *.o
del *.o
pause

View File

@ -0,0 +1,8 @@
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

View File

@ -0,0 +1,18 @@
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

View File

@ -0,0 +1,18 @@
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

View File

@ -0,0 +1,18 @@
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

View File

@ -0,0 +1,7 @@
all:
fasm loadproclib.asm
ar -csr libdialog.a loadproclib.o
install:
mv libdialog.a ../../bin/lib
clean:
rm -f *.o *.a

View File

@ -0,0 +1,39 @@
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'

View File

@ -0,0 +1,9 @@
format ELF
include '__lib__.inc'
section '.text'
public lib_name
lib_name db 0x55, 0xAA, lib_name_str, 0

View File

@ -0,0 +1,2 @@
lib_name equ @sample.obj
lib_name_str equ '/sys/lib/sample.obj'

View File

@ -0,0 +1,13 @@
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.

View File

@ -0,0 +1,5 @@
fasm __lib__.asm
fasm sample_symbol.asm
kos32-ar -ru libsample.a *.o
del *.o
pause

View File

@ -0,0 +1,18 @@
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

View File

@ -3,12 +3,10 @@
#ifndef KOLIBRI_BOXLIB_H #ifndef KOLIBRI_BOXLIB_H
#define KOLIBRI_BOXLIB_H #define KOLIBRI_BOXLIB_H
#include "sys/ksys.h"
#include <stdint.h>
#include <stddef.h>
typedef unsigned color_t; typedef unsigned color_t;
extern int kolibri_boxlib_init(void);
/* flags meaning */ /* flags meaning */
#define ed_figure_only 0b1000000000000000 // одни символы #define ed_figure_only 0b1000000000000000 // одни символы
#define ed_always_focus 0b100000000000000 // всегда с курсором (фокусом) #define ed_always_focus 0b100000000000000 // всегда с курсором (фокусом)
@ -68,10 +66,10 @@ typedef struct {
uint32_t ar_offset; uint32_t ar_offset;
} __attribute__ ((__packed__)) scrollbar; } __attribute__ ((__packed__)) scrollbar;
extern void __stdcall (*scrollbar_h_draw)(scrollbar*); extern void (*scrollbar_h_draw __attribute__((__stdcall__)))(scrollbar*);
extern void __stdcall (*scrollbar_h_mouse)(scrollbar*); extern void (*scrollbar_h_mouse __attribute__((__stdcall__)))(scrollbar*);
extern void __stdcall (*scrollbar_v_draw)(scrollbar*); extern void (*scrollbar_v_draw __attribute__((__stdcall__)))(scrollbar*);
extern void __stdcall (*scrollbar_v_mouse)(scrollbar*); extern void (*scrollbar_v_mouse __attribute__((__stdcall__)))(scrollbar*);
// CHECKBOX // CHECKBOX
typedef struct { typedef struct {
@ -88,9 +86,9 @@ typedef struct {
unsigned int size_of_str; unsigned int size_of_str;
}check_box; }check_box;
extern void __stdcall (*check_box_draw2)(check_box *); extern void (*check_box_draw2 __attribute__((__stdcall__)))(check_box *);
extern void __stdcall (*check_box_mouse2)(check_box *); extern void (*check_box_mouse2 __attribute__((__stdcall__)))(check_box *);
extern void __stdcall (*init_checkbox2)(check_box *); extern void (*init_checkbox2 __attribute__((__stdcall__)))(check_box *);
// DBUTTON // DBUTTON
typedef struct { typedef struct {
@ -110,8 +108,8 @@ typedef struct {
uint32_t click; // clicked - 1, zero it after tested uint32_t click; // clicked - 1, zero it after tested
} pict_button; } pict_button;
extern void __stdcall (*dynamic_button_draw)(pict_button *); extern void (*dynamic_button_draw __attribute__((__stdcall__)))(pict_button *);
extern void __stdcall (*dynamic_button_mouse)(pict_button *); extern void (*dynamic_button_mouse __attribute__((__stdcall__)))(pict_button *);
// EDITBOX // EDITBOX
@ -143,20 +141,10 @@ typedef struct edit_box_t {
}edit_box; }edit_box;
#pragma pack(pop) #pragma pack(pop)
extern void __stdcall (*edit_box_draw)(edit_box *) __asm__("edit_box"); extern void (*edit_box_draw __attribute__((__stdcall__)))(edit_box *);
extern void __stdcall (*edit_box_key)(edit_box *, unsigned int key_val); extern void edit_box_key (edit_box *, unsigned int key_val)__attribute__((__stdcall__));
extern void __stdcall (*edit_box_mouse)(edit_box *); extern void (*edit_box_mouse __attribute__((__stdcall__)))(edit_box *);
extern void __stdcall (*edit_box_set_text)(edit_box *, char *); extern void (*edit_box_set_text __attribute__((__stdcall__)))(edit_box *, char *);
void edit_box_key_safe(edit_box *e, ksys_oskey_t ch) {
int a=3;
asm_inline (
"pushl %2 \n\t"
"call *%1 \n\t"
::"a"(ch.val), "m"(edit_box_key), "m"(e)
:"memory"
);
}
// FRAME // FRAME
typedef struct { typedef struct {
@ -174,7 +162,7 @@ typedef struct {
color_t font_bg_color; color_t font_bg_color;
}frame; }frame;
extern void __stdcall (*frame_draw)(frame *); extern void (*frame_draw)(frame *);
// MENUBAR // MENUBAR
typedef struct typedef struct
@ -215,9 +203,9 @@ typedef struct
uint32_t get_mouse_flag; uint32_t get_mouse_flag;
} menubar; } menubar;
extern void __stdcall (*menu_bar_draw)(menubar *); extern void (*menu_bar_draw)(menubar *);
extern void __stdcall (*menu_bar_mouse)(menubar *); extern void (*menu_bar_mouse)(menubar *);
extern void __stdcall (*menu_bar_activate)(menubar *); extern void (*menu_bar_activate)(menubar *);
// OPTIONBOX // OPTIONBOX
typedef struct option_box_t { typedef struct option_box_t {
@ -234,8 +222,8 @@ typedef struct option_box_t {
uint32_t flags; uint32_t flags;
} __attribute__ ((__packed__)) option_box; } __attribute__ ((__packed__)) option_box;
extern void __stdcall (*option_box_draw)(option_box **); extern void (*option_box_draw __attribute__((__stdcall__)))(option_box **);
extern void __stdcall (*option_box_mouse)(option_box **); extern void (*option_box_mouse __attribute__((__stdcall__)))(option_box **);
// PATHSHOW // PATHSHOW
typedef struct { typedef struct {
@ -252,8 +240,8 @@ typedef struct {
uint32_t temp_text_length; uint32_t temp_text_length;
} __attribute__ ((__packed__)) pathview; } __attribute__ ((__packed__)) pathview;
extern void __stdcall (*path_show_prepare)(pathview *); extern void (*path_show_prepare __attribute__((__stdcall__)))(pathview *);
extern void __stdcall (*path_show_draw)(pathview *); extern void (*path_show_draw __attribute__((__stdcall__)))(pathview *);
// PROGRESSBAR // PROGRESSBAR
typedef struct { typedef struct {
@ -270,7 +258,8 @@ typedef struct {
unsigned int frame_color; unsigned int frame_color;
} progressbar; } progressbar;
extern void __stdcall (*progressbar_draw)(progressbar *); extern void (*progressbar_draw __attribute__((__stdcall__)))(progressbar *);
extern void __stdcall (*progressbar_progress)(progressbar *); extern void (*progressbar_progress __attribute__((__stdcall__)))(progressbar *);
#endif /* KOLIBRI_BOXLIB_H */ #endif /* KOLIBRI_BOXLIB_H */

View File

@ -2,8 +2,11 @@
#define KOLIBRI_BUF2D_H #define KOLIBRI_BUF2D_H
#include <stdint.h> #include <stdint.h>
#include <sys/ksys.h> /*ToDo
#include <stddef.h> * voxel function
*/
extern int kolibri_buf2d_init(void);
typedef struct { typedef struct {
unsigned int *buf_pointer; unsigned int *buf_pointer;
@ -30,12 +33,12 @@ enum BUF2D_OPT_CROP {
BUF2D_OPT_CROP_RIGHT = 8 BUF2D_OPT_CROP_RIGHT = 8
}; };
extern void __stdcall (*buf2d_create_asm)(buf2d_struct *); extern void (*buf2d_create_asm __attribute__((__stdcall__)))(buf2d_struct *);
extern void __stdcall (*buf2d_curve_bezier_asm)(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int); extern void (*buf2d_curve_bezier_asm __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int);
buf2d_struct* buf2d_create(uint16_t tlx, uint16_t tly, unsigned int sizex, unsigned int sizey, unsigned int font_bgcolor, uint8_t color_bit) buf2d_struct* buf2d_create(uint16_t tlx, uint16_t tly, unsigned int sizex, unsigned int sizey, unsigned int font_bgcolor, uint8_t color_bit)
{ {
buf2d_struct *new_buf2d_struct = (buf2d_struct *)_ksys_alloc(sizeof(buf2d_struct)); buf2d_struct *new_buf2d_struct = (buf2d_struct *)malloc(sizeof(buf2d_struct));
new_buf2d_struct -> left = tlx; new_buf2d_struct -> left = tlx;
new_buf2d_struct -> top = tly; new_buf2d_struct -> top = tly;
new_buf2d_struct -> width = sizex; new_buf2d_struct -> width = sizex;
@ -51,31 +54,30 @@ void buf2d_curve_bezier(buf2d_struct *buf, unsigned int p0_x, unsigned int p0_y,
buf2d_curve_bezier_asm(buf, (p0_x<<16)+p0_y, (p1_x<<16)+p1_y, (p2_x<<16)+p2_y, color); buf2d_curve_bezier_asm(buf, (p0_x<<16)+p0_y, (p1_x<<16)+p1_y, (p2_x<<16)+p2_y, color);
} }
extern void __stdcall (*buf2d_draw)(buf2d_struct *); extern void (*buf2d_draw __attribute__((__stdcall__)))(buf2d_struct *);
extern void __stdcall (*buf2d_clear)(buf2d_struct *, unsigned int); extern void (*buf2d_clear __attribute__((__stdcall__)))(buf2d_struct *, unsigned int);
extern void __stdcall (*buf2d_delete)(buf2d_struct *); extern void (*buf2d_delete __attribute__((__stdcall__)))(buf2d_struct *);
extern void __stdcall (*buf2d_rotate)(buf2d_struct *, unsigned int); extern void (*buf2d_rotate __attribute__((__stdcall__)))(buf2d_struct *, unsigned int);
extern void __stdcall (*buf2d_resize)(buf2d_struct *, unsigned int, unsigned int, unsigned int); extern void (*buf2d_resize __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int);
extern void __stdcall (*buf2d_line)(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); extern void (*buf2d_line __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
extern void __stdcall (*buf2d_line_sm)(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int); extern void (*buf2d_line_sm __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int);
extern void __stdcall (*buf2d_rect_by_size)(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); extern void (*buf2d_rect_by_size __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
extern void __stdcall (*buf2d_filled_rect_by_size)(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); extern void (*buf2d_filled_rect_by_size __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
extern void __stdcall (*buf2d_circle)(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int); extern void (*buf2d_circle __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int);
extern void __stdcall (*buf2d_img_hdiv2)(buf2d_struct *); extern void (*buf2d_img_hdiv2 __attribute__((__stdcall__)))(buf2d_struct *);
extern void __stdcall (*buf2d_img_wdiv2)(buf2d_struct *); extern void (*buf2d_img_wdiv2 __attribute__((__stdcall__)))(buf2d_struct *);
extern void __stdcall (*buf2d_conv_24_to_8)(buf2d_struct *, unsigned int); extern void (*buf2d_conv_24_to_8 __attribute__((__stdcall__)))(buf2d_struct *, unsigned int);
extern void __stdcall (*buf2d_conv_24_to_32)(buf2d_struct *, unsigned int); extern void (*buf2d_conv_24_to_32 __attribute__((__stdcall__)))(buf2d_struct *, unsigned int);
extern void __stdcall (*buf2d_bit_blt_transp)(buf2d_struct *, unsigned int, unsigned int, buf2d_struct *); extern void (*buf2d_bit_blt_transp __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, buf2d_struct *);
extern void __stdcall (*buf2d_bit_blt_alpha)(buf2d_struct *, unsigned int, unsigned int, buf2d_struct *); extern void (*buf2d_bit_blt_alpha __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, buf2d_struct *);
extern void __stdcall (*buf2d_convert_text_matrix)(buf2d_struct *); extern void (*buf2d_convert_text_matrix __attribute__((__stdcall__)))(buf2d_struct *);
extern void __stdcall (*buf2d_draw_text)(buf2d_struct *, buf2d_struct *, const char *, unsigned int, unsigned int); extern void (*buf2d_draw_text __attribute__((__stdcall__)))(buf2d_struct *, buf2d_struct *, const char *, unsigned int, unsigned int);
extern void __stdcall (*buf2d_crop_color)(buf2d_struct *, unsigned int, unsigned int); extern void (*buf2d_crop_color __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int);
extern void __stdcall (*buf2d_offset_h)(buf2d_struct *, unsigned int, unsigned int, unsigned int); extern void (*buf2d_offset_h __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int);
extern void __stdcall (*buf2d_flood_fill)(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int); extern void (*buf2d_flood_fill __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int);
extern void __stdcall (*buf2d_set_pixel)(buf2d_struct *, unsigned int, unsigned int, unsigned int); extern void (*buf2d_set_pixel __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int);
extern unsigned __stdcall (*buf2d_get_pixel)(buf2d_struct *, unsigned int, unsigned int); extern unsigned int (*buf2d_get_pixel __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int);
extern void __stdcall (*buf2d_flip_h)(buf2d_struct *); extern void (*buf2d_flip_h __attribute__((__stdcall__)))(buf2d_struct *);
extern void __stdcall (*buf2d_flip_v)(buf2d_struct *); extern void (*buf2d_flip_v __attribute__((__stdcall__)))(buf2d_struct *);
extern void __stdcall (*buf2d_filter_dither)(buf2d_struct *, unsigned int); extern void (*buf2d_filter_dither __attribute__((__stdcall__)))(buf2d_struct *, unsigned int);
#endif /* KOLIBRI_BUF2D_H */ #endif /* KOLIBRI_BUF2D_H */

View File

@ -2,7 +2,6 @@
#define KOLIBRI_DIALOG_H #define KOLIBRI_DIALOG_H
#include <stdlib.h> #include <stdlib.h>
#define NOT_SUCCESS 0 #define NOT_SUCCESS 0
#define SUCCESS 1 #define SUCCESS 1
@ -116,10 +115,12 @@ color_dialog* kolibri_new_color_dialog(unsigned int type, unsigned short tlx, un
return new_colordialog; return new_colordialog;
} }
extern void __stdcall (*OpenDialog_init)(open_dialog *); extern void kolibri_dialog_init();
extern void __stdcall (*OpenDialog_start)(open_dialog *);
extern void __stdcall (*ColorDialog_init)(color_dialog *); extern void (*OpenDialog_init __attribute__((__stdcall__)))(open_dialog *);
extern void __stdcall (*ColorDialog_start)(color_dialog *); extern void (*OpenDialog_start __attribute__((__stdcall__)))(open_dialog *);
extern void (*ColorDialog_init __attribute__((__stdcall__)))(color_dialog *);
extern void (*ColorDialog_start __attribute__((__stdcall__)))(color_dialog *);
#endif #endif

View File

@ -1,5 +1,3 @@
#ifndef KOLIBRI_GB_H
#define KOLIBRI_GB_H
#pragma pack(push, 1) #pragma pack(push, 1)
typedef struct typedef struct
@ -19,5 +17,3 @@ void gb_bar(GB_BMP *b, int x, int y, int w, int h, unsigned c);
void gb_circle(GB_BMP *b, int x, int y, int r, unsigned c); void gb_circle(GB_BMP *b, int x, int y, int r, unsigned c);
void gb_image_set(GB_BMP *b_dest, int x_d, int y_d, GB_BMP *b_src, int x_s, int y_s, int w, int h); void gb_image_set(GB_BMP *b_dest, int x_d, int y_d, GB_BMP *b_src, int x_s, int y_s, int w, int h);
void gb_image_set_t(GB_BMP *b_dest, int x_d, int y_d, GB_BMP *b_src, int x_s, int y_s, int w, int h, unsigned c); void gb_image_set_t(GB_BMP *b_dest, int x_d, int y_d, GB_BMP *b_src, int x_s, int y_s, int w, int h, unsigned c);
#endif // KOLIBRI_GB_H

View File

@ -5,10 +5,11 @@
Adapted for TCC's dynamic API by Magomed Kostoev, 2020 Adapted for TCC's dynamic API by Magomed Kostoev, 2020
*/ */
#ifndef KOLIBRI_HTTP_H #ifndef _HTTP_H_
#define KOLIBRI_HTTP_H #define _HTTP_H_
#include <stddef.h> #define cdecl __attribute__ ((cdecl))
#define stdcall __attribute__ ((stdcall))
// Bitflags for http_msg.flags // Bitflags for http_msg.flags
// status // status
@ -79,7 +80,7 @@ typedef struct http_msg_s {
Initiates a HTTP connection, using 'GET' method. Initiates a HTTP connection, using 'GET' method.
Returns NULL on error, identifier otherwise. Returns NULL on error, identifier otherwise.
*/ */
extern http_msg * __stdcall (*http_get)(const char *url, http_msg *identifier, unsigned flags, const char *add_header); extern http_msg * stdcall (*http_get)(const char *url, http_msg *identifier, unsigned flags, const char *add_header);
/* /*
url = pointer to ASCIIZ URL url = pointer to ASCIIZ URL
@ -90,7 +91,7 @@ extern http_msg * __stdcall (*http_get)(const char *url, http_msg *identifier, u
Initiate a HTTP connection, using 'HEAD' method. Initiate a HTTP connection, using 'HEAD' method.
Returns NULL on error, identifier otherwise. Returns NULL on error, identifier otherwise.
*/ */
extern http_msg * __stdcall (*http_head)(const char *url, http_msg *identifier, unsigned flags, const char *add_header); extern http_msg * stdcall (*http_head)(const char *url, http_msg *identifier, unsigned flags, const char *add_header);
/* /*
url = pointer to ASCIIZ URL url = pointer to ASCIIZ URL
@ -105,7 +106,7 @@ extern http_msg * __stdcall (*http_head)(const char *url, http_msg *identifier,
using system function 75, 6. using system function 75, 6.
Returns 0 on error, identifier otherwise Returns 0 on error, identifier otherwise
*/ */
extern http_msg * __stdcall (*http_post)(const char *url, http_msg *identifier, unsigned flags, const char *add_header, extern http_msg * stdcall (*http_post)(const char *url, http_msg *identifier, unsigned flags, const char *add_header,
const char *content_type, unsigned content_length); const char *content_type, unsigned content_length);
/* /*
@ -127,7 +128,7 @@ extern http_msg * __stdcall (*http_post)(const char *url, http_msg *identifier,
In content_length you'll find the length of the content. In content_length you'll find the length of the content.
In content_received, you'll find the number of content bytes already received. In content_received, you'll find the number of content bytes already received.
*/ */
extern int __stdcall (*http_receive)(http_msg *identifier); extern int stdcall (*http_receive)(http_msg *identifier);
/* /*
identifier = identifier which one of the previous functions returned identifier = identifier which one of the previous functions returned
@ -136,17 +137,17 @@ extern int __stdcall (*http_receive)(http_msg *identifier);
This procedure can be used to send data to the server (POST) This procedure can be used to send data to the server (POST)
Returns number of bytes sent, -1 on error Returns number of bytes sent, -1 on error
*/ */
extern int __stdcall (*http_send)(http_msg *identifier, void *dataptr, unsigned datalength); extern int stdcall (*http_send)(http_msg *identifier, void *dataptr, unsigned datalength);
/* /*
Sometimes the http_receive function receives incomplete data. If you have the same problem then a macro can help you: Sometimes the http_receive function receives incomplete data. If you have the same problem then a macro can help you:
*/ */
extern int __stdcall (*http_free)(http_msg *identifier); extern int stdcall (*http_free)(http_msg *identifier);
/* /*
Free unused data Free unused data
*/ */
#define http_long_receive(x) while(http_receive(x)){}; #define http_long_receive(x) while(http_receive(x)){};
#endif // KOLIBRI_HTTP_H #endif // _HTTP_H_

View File

@ -5,12 +5,13 @@
Adapted for TCC's dynamic API by Magomed Kostoev, 2020 Adapted for TCC's dynamic API by Magomed Kostoev, 2020
*/ */
#ifndef KOLIBRI_INPUTBOX_H #ifndef __KOS__INPUTBOX__H________
#define KOLIBRI_INPUTBOX_H #define __KOS__INPUTBOX__H________
#include <stddef.h> #define cdecl __attribute__ ((cdecl))
#define stdcall __attribute__ ((stdcall))
extern unsigned __stdcall (*InputBox)(void* Buffer, char* Caption, char* Prompt, char* Default, extern unsigned stdcall (*InputBox)(void* Buffer, char* Caption, char* Prompt, char* Default,
unsigned long Flags, unsigned long BufferSize, void* RedrawProc); unsigned long Flags, unsigned long BufferSize, void* RedrawProc);
#endif // KOLIBRI_INPUTBOX_H #endif // __KOS__INPUTBOX__H________

View File

@ -6,6 +6,10 @@
#include <stddef.h> #include <stddef.h>
#include <stdbool.h> #include <stdbool.h>
extern int kolibri_libimg_init(void);
#define _stdcall __attribute__((__stdcall__))
//list of format id's //list of format id's
#define LIBIMG_FORMAT_BMP 1 #define LIBIMG_FORMAT_BMP 1
#define LIBIMG_FORMAT_ICO 2 #define LIBIMG_FORMAT_ICO 2
@ -95,23 +99,23 @@ typedef struct{
#define ROTATE_90_CCW ROTATE_270_CW #define ROTATE_90_CCW ROTATE_270_CW
#define ROTATE_270_CCW ROTATE_90_CW #define ROTATE_270_CCW ROTATE_90_CW
extern Image* __stdcall (*img_decode)(void* file_data, uint32_t size, uint32_t b_color); extern Image* (*img_decode _stdcall)(void* file_data, uint32_t size, uint32_t b_color);
extern Image* __stdcall (*img_encode)(Image* img, uint32_t length, uint32_t option); extern Image* (*img_encode _stdcall)(Image* img, uint32_t length, uint32_t option);
extern Image* __stdcall (*img_create)(uint32_t width, uint32_t height, uint32_t type); extern Image* (*img_create _stdcall)(uint32_t width, uint32_t height, uint32_t type);
extern void __stdcall (*img_to_rgb2)(Image* img, void *rgb_data); extern void (*img_to_rgb2 _stdcall)(Image* img, void *rgb_data);
extern Image* __stdcall (*img_to_rgb)(Image* img); extern Image* (*img_to_rgb _stdcall)(Image* img);
extern bool __stdcall (*img_flip)(Image* img, uint32_t flip); extern bool (*img_flip _stdcall)(Image* img, uint32_t flip);
extern bool __stdcall (*img_flip_layer)(Image *img, uint32_t flip); extern bool (*img_flip_layer _stdcall)(Image *img, uint32_t flip);
extern bool __stdcall (*img_rotate)(Image *img, uint32_t rotate); extern bool (*img_rotate _stdcall)(Image *img, uint32_t rotate);
extern bool __stdcall (*img_rotate_layer)(Image* data, uint32_t rotate); extern bool (*img_rotate_layer _stdcall)(Image* data, uint32_t rotate);
extern void __stdcall (*img_draw)(Image *img, uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint32_t xoff, uint32_t yoff); extern void (*img_draw _stdcall)(Image *img, uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint32_t xoff, uint32_t yoff);
extern int32_t __stdcall (*img_count)(Image *img); extern int32_t (*img_count _stdcall)(Image *img);
extern bool __stdcall (*img_destroy)(Image *img); extern bool (*img_destroy _stdcall)(Image *img);
extern bool __stdcall (*img_destroy_layer)(Image* img); extern bool (*img_destroy_layer _stdcall)(Image* img);
extern Image* __stdcall (*img_blend)(Image* dst, Image* src, uint32_t out_x, uint32_t out_y, uint32_t in_x, uint32_t in_y, uint32_t width, uint32_t height); extern Image* (*img_blend _stdcall)(Image* dst, Image* src, uint32_t out_x, uint32_t out_y, uint32_t in_x, uint32_t in_y, uint32_t width, uint32_t height);
extern Image* __stdcall (*img_convert)(Image *src, Image *dst, uint32_t dst_type, uint32_t, uint32_t); extern Image* (*img_convert _stdcall)(Image *src, Image *dst, uint32_t dst_type, uint32_t, uint32_t);
extern Image* __stdcall (*img_resize_data)(Image *src, uint32_t width, uint32_t height); extern Image* (*img_resize_data _stdcall)(Image *src, uint32_t width, uint32_t height);
extern Image* __stdcall (*img_scale)(Image* src, uint32_t crop_x, uint32_t crop_y, uint32_t crop_width, uint32_t crop_height, Image* dst, uint32_t scale_type, uint32_t inter, uint32_t new_width, uint32_t new_height); extern Image* (*img_scale _stdcall)(Image* src, uint32_t crop_x, uint32_t crop_y, uint32_t crop_width, uint32_t crop_height, Image* dst, uint32_t scale_type, uint32_t inter, uint32_t new_width, uint32_t new_height);
void img_fill_color(Image* img, uint32_t width, uint32_t height, uint32_t color){ void img_fill_color(Image* img, uint32_t width, uint32_t height, uint32_t color){
for (uint32_t i = 0; i < width*height; i++) { for (uint32_t i = 0; i < width*height; i++) {

View File

@ -1,11 +1,11 @@
#ifndef KOLIBRI_MSGBOX_H #ifndef KOLIBRI_MSGBOX_H
#define KOLIBRI_MSGBOX_H #define KOLIBRI_MSGBOX_H
#include <stdarg.h> #include <stdarg.h>
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
typedef struct { typedef struct {
uint8_t retval; // 0 - win closed, 1 to n - button num, also default button on start uint8_t retval; // 0 - win closed, 1 to n - button num, also default button on start
uint8_t reserv; uint8_t reserv;
@ -16,9 +16,9 @@ typedef struct {
typedef void (*msgbox_callback)(void); typedef void (*msgbox_callback)(void);
extern void __stdcall (*mb_create)(msgbox *, void *thread); // clears callbacks, ! if fix lib, we can return eax as of Fn51 extern void (*msgbox_create __attribute__((__stdcall__)))(msgbox *, void *thread); // clears callbacks, ! if fix lib, we can return eax as of Fn51
extern void __stdcall (*mb_setfunctions)(msgbox_callback*); // must be called immediately after create, zero-ended array extern void (*msgbox_setfunctions __attribute__((__stdcall__)))(msgbox_callback*); // must be called immediately after create, zero-ended array
extern void __stdcall (*mb_reinit)(msgbox *); // recalc sizes when structure changes, called auto when MsgBoxCreate extern void (*msgbox_reinit __attribute__((__stdcall__)))(msgbox *) ; // recalc sizes when structure changes, called auto when MsgBoxCreate
static inline msgbox* kolibri_new_msgbox(char* title, char* text, int def_but, ...) static inline msgbox* kolibri_new_msgbox(char* title, char* text, int def_but, ...)
/// text can be multilined by code 13 = "\r" /// text can be multilined by code 13 = "\r"
@ -48,8 +48,8 @@ static inline msgbox* kolibri_new_msgbox(char* title, char* text, int def_but, .
static inline void kolibri_start_msgbox(msgbox* box, msgbox_callback cb[]) static inline void kolibri_start_msgbox(msgbox* box, msgbox_callback cb[])
{ {
mb_create(box, &box->top_stack); (*msgbox_create)(box, &box->top_stack);
if (cb) mb_setfunctions(cb); if (cb) (*msgbox_setfunctions)(cb);
} }
#endif #endif

View File

@ -1,9 +1,11 @@
#ifndef KOLIBRI_NETWORK_H #ifndef __NETWORK_H
#define KOLIBRI_NETWORK_H #define __NETWORK_H
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/ksys.h> #include <sys/ksys.h>
#define stdcall __attribute__ ((stdcall))
#define EAI_ADDRFAMILY 1 #define EAI_ADDRFAMILY 1
#define EAI_AGAIN 2 #define EAI_AGAIN 2
#define EAI_BADFLAGS 3 #define EAI_BADFLAGS 3
@ -46,9 +48,10 @@ struct addrinfo {
}; };
#pragma pack(pop) #pragma pack(pop)
extern int __stdcall (*inet_addr)(const char* hostname); extern int networklib_init ();
extern char* __stdcall (*inet_ntoa)(int ip_addr); extern int stdcall (*inet_addr)(const char* hostname);
extern int __stdcall (*getaddrinfo)(const char* hostname, const char* servname, const struct addrinfo* hints, struct addrinfo** res); extern char* stdcall (*inet_ntoa)(int ip_addr);
extern void __stdcall (*freeaddrinfo)(struct addrinfo* ai); extern int stdcall (*getaddrinfo)(const char* hostname, const char* servname, const struct addrinfo* hints, struct addrinfo** res);
extern void stdcall (*freeaddrinfo)(struct addrinfo* ai);
#endif #endif

View File

@ -1,11 +1,11 @@
#ifndef KOLIBRI_RASTERWORKS_H #ifndef KOLIBRI_RASTERWORKS_H
#define KOLIBRI_RASTERWORKS_H #define KOLIBRI_RASTERWORKS_H
#include <stddef.h> //extern int kolibri_rasterworks_init(void);
extern void __stdcall (*drawText)(void *canvas, int x, int y, const char *string, int charQuantity, int fontColor, int params); extern void (*drawText __attribute__((__stdcall__)))(void *canvas, int x, int y, const char *string, int charQuantity, int fontColor, int params);
extern int __stdcall (*countUTF8Z)(const char *string, int byteQuantity) __asm__("cntUTF-8"); extern int (*countUTF8Z __attribute__((__stdcall__)))(const char *string, int byteQuantity);
extern int __stdcall (*charsFit)(int areaWidth, int charHeight); extern int (*charsFit __attribute__((__stdcall__)))(int areaWidth, int charHeight);
extern int __stdcall (*strWidth)(int charQuantity, int charHeight); extern int (*strWidth __attribute__((__stdcall__)))(int charQuantity, int charHeight);
#endif /* KOLIBRI_RASTERWORKS_H */ #endif /* KOLIBRI_RASTERWORKS_H */

View File

@ -11,6 +11,9 @@ Adapted for tcc by Siemargl, 2016
#include <stddef.h> #include <stddef.h>
#define cdecl __attribute__ ((cdecl))
#define stdcall __attribute__ ((stdcall))
/* /*
console.obj exports the following functions console.obj exports the following functions
*/ */
@ -35,25 +38,25 @@ typedef unsigned short word; /* 16-bit unsigned integer */
extern int _FUNC(con_init)(void); extern int _FUNC(con_init)(void);
extern int _FUNC(con_init_opt)(dword wnd_width, dword wnd_height, dword scr_width, dword scr_height, const char* title); extern int _FUNC(con_init_opt)(dword wnd_width, dword wnd_height, dword scr_width, dword scr_height, const char* title);
extern void __stdcall _FUNC((*con_exit))(int bCloseWindow); extern void stdcall _FUNC((*con_exit))(int bCloseWindow);
extern void __stdcall _FUNC((*con_set_title))(const char* title); extern void stdcall _FUNC((*con_set_title))(const char* title);
extern void __stdcall _FUNC((*con_write_asciiz))(const char* str); extern void stdcall _FUNC((*con_write_asciiz))(const char* str);
extern void __stdcall _FUNC((*con_write_string))(const char* str, dword length); extern void stdcall _FUNC((*con_write_string))(const char* str, dword length);
extern int __cdecl _FUNC((*con_printf))(const char* format, ...); extern int cdecl _FUNC((*con_printf))(const char* format, ...);
extern dword __stdcall _FUNC((*con_get_flags))(void); extern dword stdcall _FUNC((*con_get_flags))(void);
extern dword __stdcall _FUNC((*con_set_flags))(dword new_flags); extern dword stdcall _FUNC((*con_set_flags))(dword new_flags);
extern int __stdcall _FUNC((*con_get_font_height))(void); extern int stdcall _FUNC((*con_get_font_height))(void);
extern int __stdcall _FUNC((*con_get_cursor_height))(void); extern int stdcall _FUNC((*con_get_cursor_height))(void);
extern int __stdcall _FUNC((*con_set_cursor_height))(int new_height); extern int stdcall _FUNC((*con_set_cursor_height))(int new_height);
extern int __stdcall _FUNC((*con_getch))(void); extern int stdcall _FUNC((*con_getch))(void);
extern word __stdcall _FUNC((*con_getch2))(void); extern word stdcall _FUNC((*con_getch2))(void);
extern int __stdcall _FUNC((*con_kbhit))(void); extern int stdcall _FUNC((*con_kbhit))(void);
extern char* __stdcall _FUNC((*con_gets))(char* str, int n); extern char* stdcall _FUNC((*con_gets))(char* str, int n);
typedef int __stdcall _FUNC(* con_gets2_callback)(int keycode, char** pstr, int* pn, int* ppos); typedef int (stdcall _FUNC(* con_gets2_callback))(int keycode, char** pstr, int* pn, int* ppos);
extern char* __stdcall _FUNC((*con_gets2))(con_gets2_callback callback, char* str, int n); extern char* stdcall _FUNC((*con_gets2))(con_gets2_callback callback, char* str, int n);
extern void __stdcall _FUNC((*con_cls))(); extern void stdcall _FUNC((*con_cls))();
extern void __stdcall _FUNC((*con_get_cursor_pos))(int* px, int* py); extern void stdcall _FUNC((*con_get_cursor_pos))(int* px, int* py);
extern void __stdcall _FUNC((*con_set_cursor_pos))(int x, int y); extern void stdcall _FUNC((*con_set_cursor_pos))(int x, int y);
extern int _FUNC(__con_is_load); extern int _FUNC(__con_is_load);
#endif #endif

View File

@ -34,12 +34,4 @@ typedef uint64_t uintmax_t;
#define offsetof(type, field) ((size_t)&((type *)0)->field) #define offsetof(type, field) ((size_t)&((type *)0)->field)
#ifndef __stdcall
#define __stdcall __attribute__((stdcall))
#endif
#ifndef __cdecl
#define __cdecl __attribute__((cdecl))
#endif
#endif /* _STDDEF_H_ */ #endif /* _STDDEF_H_ */

View File

@ -219,7 +219,7 @@ enum KSYS_FILE_ENCODING{
}; };
static inline static inline
int __strcmp(const char * s1, const char * s2 ) int _ksys_strcmp(const char * s1, const char * s2 )
{ {
while ((*s1) && (*s1 == *s2)){ ++s1; ++s2; } while ((*s1) && (*s1 == *s2)){ ++s1; ++s2; }
return(*(unsigned char*)s1 - *(unsigned char *)s2); return(*(unsigned char*)s1 - *(unsigned char *)s2);
@ -1163,7 +1163,7 @@ void* _ksys_dlsym(ksys_dll_t *table, const char* fun_name){
if (!(table+i)->func_name){ if (!(table+i)->func_name){
break; break;
}else{ }else{
if (!__strcmp(fun_name, (table+i)->func_name)){ if (!_ksys_strcmp(fun_name, (table+i)->func_name)){
return (table+i)->func_ptr; return (table+i)->func_ptr;
} }
} }

Binary file not shown.

View File

@ -1,9 +1,8 @@
KTCC=../../bin/kos32-tcc KTCC=kos32-tcc
FASM= fasm FASM= fasm
KPACK = kpack KPACK = kpack
CFLAGS = -I../include -I../../../../../../contrib/sdk/sources/SDL-1.2.2_newlib/include CFLAGS = -I../include -I../../../../../../contrib/sdk/sources/SDL-1.2.2_newlib/include
LIBS = -lbox_lib -lshell -lSDL -lsound -lnetwork -lrasterworks -limg -ldialog -lmsgbox LDFLAGS = -nostdlib -L../../bin/lib ../../bin/lib/crt0.o
BIN= stdio_test.kex \ BIN= stdio_test.kex \
basic_gui.kex \ basic_gui.kex \
@ -15,6 +14,7 @@ BIN = stdio_test.kex \
tmpdisk_work.kex \ tmpdisk_work.kex \
consoleio.kex \ consoleio.kex \
assert_test.kex \ assert_test.kex \
fasm/sprintf_test.kex \
clayer/rasterworks.kex \ clayer/rasterworks.kex \
clayer/libimg.kex \ clayer/libimg.kex \
clayer/dialog.kex \ clayer/dialog.kex \
@ -23,8 +23,9 @@ BIN = stdio_test.kex \
thread_work.kex \ thread_work.kex \
sdltest.kex \ sdltest.kex \
shell_test.kex \ shell_test.kex \
libc_test.kex \ libc_test.kex
defgen.kex
LIBS= -lSDL -lshell -ltcc -lsound -ldialog -lrasterworks -limg -lbox -lmsgbox -lnetwork -lc.obj
all: $(BIN) all: $(BIN)
@ -32,7 +33,7 @@ all: $(BIN)
$(KTCC) $(CFLAGS) $(LDFLAGS) $< -o $@ $(LIBS) $(KTCC) $(CFLAGS) $(LDFLAGS) $< -o $@ $(LIBS)
$(KPACK) --nologo $@ $(KPACK) --nologo $@
-%.kex : %.asm %.kex : %.asm
$(FASM) $< $@ $(FASM) $< $@
$(KPACK) --nologo $@ $(KPACK) --nologo $@

View File

@ -1,24 +1,24 @@
#SHS #SHS
mkdir /tmp0/1/tcc_samples mkdir /tmp0/1/tcc_samples
../tcc file_io.c -o /tmp0/1/tcc_samples/file_io ../tcc file_io.c -o /tmp0/1/tcc_samples/file_io -lc.obj
../tcc whois.c -o /tmp0/1/tcc_samples/whois -lnetwork ../tcc whois.c -o /tmp0/1/tcc_samples/whois -ltcc -lnetwork -lc.obj
../tcc stdio_test.c -o /tmp0/1/tcc_samples/stdio_test ../tcc stdio_test.c -o /tmp0/1/tcc_samples/stdio_test -lc.obj
../tcc basic_gui.c -o /tmp0/1/tcc_samples/basic_gui ../tcc basic_gui.c -o /tmp0/1/tcc_samples/basic_gui -ltcc -lc.obj
../tcc consoleio.c -o /tmp0/1/tcc_samples/consoleio ../tcc consoleio.c -o /tmp0/1/tcc_samples/consoleio -lc.obj
../tcc dir_example.c -o /tmp0/1/tcc_samples/ls_dir ../tcc dir_example.c -o /tmp0/1/tcc_samples/ls_dir -lc.obj
../tcc http_tcp_demo.c -o /tmp0/1/tcc_samples/http_tcp_demo -lnetwork ../tcc http_tcp_demo.c -o /tmp0/1/tcc_samples/http_tcp_demo -ltcc -lnetwork -lc.obj
../tcc math_test.c -o /tmp0/1/tcc_samples/math_test ../tcc math_test.c -o /tmp0/1/tcc_samples/math_test -ltcc -lc.obj
../tcc string_test.c -o /tmp0/1/tcc_samples/string_test ../tcc string_test.c -o /tmp0/1/tcc_samples/string_test -ltcc -lc.obj
../tcc tmpdisk_work.c -o /tmp0/1/tcc_samples/tmpdisk_work ../tcc tmpdisk_work.c -o /tmp0/1/tcc_samples/tmpdisk_work -ltcc -lc.obj
../tcc clayer/boxlib.c -o /tmp0/1/tcc_samples/boxlib -lbox_lib ../tcc clayer/boxlib.c -o /tmp0/1/tcc_samples/boxlib -ltcc -lbox -lc.obj
../tcc clayer/dialog.c -o /tmp0/1/tcc_samples/dialog -ldialog ../tcc clayer/dialog.c -o /tmp0/1/tcc_samples/dialog -ltcc -ldialog -lc.obj
cp clayer/logo.png /tmp0/1/tcc_samples/logo.png cp clayer/logo.png /tmp0/1/tcc_samples/logo.png
../tcc clayer/libimg.c -o /tmp0/1/tcc_samples/libimg -limg ../tcc clayer/libimg.c -o /tmp0/1/tcc_samples/libimg -ltcc -limg -lc.obj
../tcc clayer/msgbox.c -o /tmp0/1/tcc_samples/msgbox -lmsgbox ../tcc clayer/msgbox.c -o /tmp0/1/tcc_samples/msgbox -ltcc -lmsgbox -lc.obj
../tcc clayer/rasterworks.c -o /tmp0/1/tcc_samples/rasterworks -lrasterworks ../tcc clayer/rasterworks.c -o /tmp0/1/tcc_samples/rasterworks -ltcc -lrasterworks -lc.obj
../tcc thread_work.c -o /tmp0/1/tcc_samples/thread_work -ltcc -lc ../tcc thread_work.c -o /tmp0/1/tcc_samples/thread_work -ltcc -lc.obj
../tcc -I../include/SDL sdltest.c -o /tmp0/1/tcc_samples/sdltest -lSDL -lsound ../tcc -I../include/SDL sdltest.c -o /tmp0/1/tcc_samples/sdltest -lSDL -lsound -ltcc -lc.obj
../tcc shell_test.c -o /tmp0/1/tcc_samples/shell_test -lshell ../tcc shell_test.c -o /tmp0/1/tcc_samples/shell_test -lshell -ltcc -lc.obj
../tcc libc_test.c -o /tmp0/1/tcc_samples/libc_test ../tcc libc_test.c -o /tmp0/1/tcc_samples/libc_test -ltcc -lc.obj
"/sys/File managers/Eolite" /tmp0/1/tcc_samples "/sys/File managers/Eolite" /tmp0/1/tcc_samples
exit exit

View File

@ -42,8 +42,10 @@ void draw_window(){
_ksys_end_draw(); _ksys_end_draw();
} }
int main() int main()
{ {
kolibri_boxlib_init();
init_checkbox2(&output_off); init_checkbox2(&output_off);
_ksys_set_event_mask(KSYS_EVM_REDRAW + KSYS_EVM_KEY + KSYS_EVM_BUTTON + KSYS_EVM_MOUSE+ KSYS_EVM_MOUSE_FILTER); _ksys_set_event_mask(KSYS_EVM_REDRAW + KSYS_EVM_KEY + KSYS_EVM_BUTTON + KSYS_EVM_MOUSE+ KSYS_EVM_MOUSE_FILTER);
while(1){ while(1){
@ -53,7 +55,7 @@ int main()
break; break;
case KSYS_EVENT_KEY: case KSYS_EVENT_KEY:
edit_box_key_safe(&ed, _ksys_get_key()); edit_box_key(&ed, _ksys_get_key().val);
draw_window(); draw_window();
break; break;

Some files were not shown because too many files have changed in this diff Show More