/programs/develop/ktcc/trunk/libc.obj/include/clayer/boxlib.h |
---|
3,12 → 3,10 |
#ifndef KOLIBRI_BOXLIB_H |
#define KOLIBRI_BOXLIB_H |
#include "sys/ksys.h" |
#include <stdint.h> |
#include <stddef.h> |
typedef unsigned color_t; |
extern int kolibri_boxlib_init(void); |
/* flags meaning */ |
#define ed_figure_only 0b1000000000000000 // одни символы |
#define ed_always_focus 0b100000000000000 // всегда с курсором (фокусом) |
68,10 → 66,10 |
uint32_t ar_offset; |
} __attribute__ ((__packed__)) scrollbar; |
extern void __stdcall (*scrollbar_h_draw)(scrollbar*); |
extern void __stdcall (*scrollbar_h_mouse)(scrollbar*); |
extern void __stdcall (*scrollbar_v_draw)(scrollbar*); |
extern void __stdcall (*scrollbar_v_mouse)(scrollbar*); |
extern void (*scrollbar_h_draw __attribute__((__stdcall__)))(scrollbar*); |
extern void (*scrollbar_h_mouse __attribute__((__stdcall__)))(scrollbar*); |
extern void (*scrollbar_v_draw __attribute__((__stdcall__)))(scrollbar*); |
extern void (*scrollbar_v_mouse __attribute__((__stdcall__)))(scrollbar*); |
// CHECKBOX |
typedef struct { |
88,9 → 86,9 |
unsigned int size_of_str; |
}check_box; |
extern void __stdcall (*check_box_draw2)(check_box *); |
extern void __stdcall (*check_box_mouse2)(check_box *); |
extern void __stdcall (*init_checkbox2)(check_box *); |
extern void (*check_box_draw2 __attribute__((__stdcall__)))(check_box *); |
extern void (*check_box_mouse2 __attribute__((__stdcall__)))(check_box *); |
extern void (*init_checkbox2 __attribute__((__stdcall__)))(check_box *); |
// DBUTTON |
typedef struct { |
110,8 → 108,8 |
uint32_t click; // clicked - 1, zero it after tested |
} pict_button; |
extern void __stdcall (*dynamic_button_draw)(pict_button *); |
extern void __stdcall (*dynamic_button_mouse)(pict_button *); |
extern void (*dynamic_button_draw __attribute__((__stdcall__)))(pict_button *); |
extern void (*dynamic_button_mouse __attribute__((__stdcall__)))(pict_button *); |
// EDITBOX |
143,21 → 141,11 |
}edit_box; |
#pragma pack(pop) |
extern void __stdcall (*edit_box_draw)(edit_box *) __asm__("edit_box"); |
extern void __stdcall (*edit_box_key)(edit_box *, unsigned int key_val); |
extern void __stdcall (*edit_box_mouse)(edit_box *); |
extern void __stdcall (*edit_box_set_text)(edit_box *, char *); |
extern void (*edit_box_draw __attribute__((__stdcall__)))(edit_box *); |
extern void edit_box_key (edit_box *, unsigned int key_val)__attribute__((__stdcall__)); |
extern void (*edit_box_mouse __attribute__((__stdcall__)))(edit_box *); |
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 |
typedef struct { |
uint32_t type; |
174,7 → 162,7 |
color_t font_bg_color; |
}frame; |
extern void __stdcall (*frame_draw)(frame *); |
extern void (*frame_draw)(frame *); |
// MENUBAR |
typedef struct |
215,9 → 203,9 |
uint32_t get_mouse_flag; |
} menubar; |
extern void __stdcall (*menu_bar_draw)(menubar *); |
extern void __stdcall (*menu_bar_mouse)(menubar *); |
extern void __stdcall (*menu_bar_activate)(menubar *); |
extern void (*menu_bar_draw)(menubar *); |
extern void (*menu_bar_mouse)(menubar *); |
extern void (*menu_bar_activate)(menubar *); |
// OPTIONBOX |
typedef struct option_box_t { |
234,8 → 222,8 |
uint32_t flags; |
} __attribute__ ((__packed__)) option_box; |
extern void __stdcall (*option_box_draw)(option_box **); |
extern void __stdcall (*option_box_mouse)(option_box **); |
extern void (*option_box_draw __attribute__((__stdcall__)))(option_box **); |
extern void (*option_box_mouse __attribute__((__stdcall__)))(option_box **); |
// PATHSHOW |
typedef struct { |
252,8 → 240,8 |
uint32_t temp_text_length; |
} __attribute__ ((__packed__)) pathview; |
extern void __stdcall (*path_show_prepare)(pathview *); |
extern void __stdcall (*path_show_draw)(pathview *); |
extern void (*path_show_prepare __attribute__((__stdcall__)))(pathview *); |
extern void (*path_show_draw __attribute__((__stdcall__)))(pathview *); |
// PROGRESSBAR |
typedef struct { |
270,7 → 258,8 |
unsigned int frame_color; |
} progressbar; |
extern void __stdcall (*progressbar_draw)(progressbar *); |
extern void __stdcall (*progressbar_progress)(progressbar *); |
extern void (*progressbar_draw __attribute__((__stdcall__)))(progressbar *); |
extern void (*progressbar_progress __attribute__((__stdcall__)))(progressbar *); |
#endif /* KOLIBRI_BOXLIB_H */ |
/programs/develop/ktcc/trunk/libc.obj/include/clayer/buf2d.h |
---|
2,9 → 2,12 |
#define KOLIBRI_BUF2D_H |
#include <stdint.h> |
#include <sys/ksys.h> |
#include <stddef.h> |
/*ToDo |
* voxel function |
*/ |
extern int kolibri_buf2d_init(void); |
typedef struct { |
unsigned int *buf_pointer; |
uint16_t left; |
30,12 → 33,12 |
BUF2D_OPT_CROP_RIGHT = 8 |
}; |
extern void __stdcall (*buf2d_create_asm)(buf2d_struct *); |
extern void __stdcall (*buf2d_curve_bezier_asm)(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int); |
extern void (*buf2d_create_asm __attribute__((__stdcall__)))(buf2d_struct *); |
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 *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 -> top = tly; |
new_buf2d_struct -> width = sizex; |
51,31 → 54,30 |
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 __stdcall (*buf2d_clear)(buf2d_struct *, unsigned int); |
extern void __stdcall (*buf2d_delete)(buf2d_struct *); |
extern void __stdcall (*buf2d_rotate)(buf2d_struct *, unsigned int); |
extern void __stdcall (*buf2d_resize)(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 __stdcall (*buf2d_line_sm)(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 __stdcall (*buf2d_filled_rect_by_size)(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 __stdcall (*buf2d_img_hdiv2)(buf2d_struct *); |
extern void __stdcall (*buf2d_img_wdiv2)(buf2d_struct *); |
extern void __stdcall (*buf2d_conv_24_to_8)(buf2d_struct *, unsigned int); |
extern void __stdcall (*buf2d_conv_24_to_32)(buf2d_struct *, unsigned int); |
extern void __stdcall (*buf2d_bit_blt_transp)(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 __stdcall (*buf2d_convert_text_matrix)(buf2d_struct *); |
extern void __stdcall (*buf2d_draw_text)(buf2d_struct *, buf2d_struct *, const char *, unsigned int, unsigned int); |
extern void __stdcall (*buf2d_crop_color)(buf2d_struct *, unsigned int, unsigned int); |
extern void __stdcall (*buf2d_offset_h)(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 __stdcall (*buf2d_set_pixel)(buf2d_struct *, unsigned int, unsigned int, unsigned int); |
extern unsigned __stdcall (*buf2d_get_pixel)(buf2d_struct *, unsigned int, unsigned int); |
extern void __stdcall (*buf2d_flip_h)(buf2d_struct *); |
extern void __stdcall (*buf2d_flip_v)(buf2d_struct *); |
extern void __stdcall (*buf2d_filter_dither)(buf2d_struct *, unsigned int); |
extern void (*buf2d_draw __attribute__((__stdcall__)))(buf2d_struct *); |
extern void (*buf2d_clear __attribute__((__stdcall__)))(buf2d_struct *, unsigned int); |
extern void (*buf2d_delete __attribute__((__stdcall__)))(buf2d_struct *); |
extern void (*buf2d_rotate __attribute__((__stdcall__)))(buf2d_struct *, unsigned int); |
extern void (*buf2d_resize __attribute__((__stdcall__)))(buf2d_struct *, 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 (*buf2d_line_sm __attribute__((__stdcall__)))(buf2d_struct *, 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 (*buf2d_filled_rect_by_size __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, 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 (*buf2d_img_hdiv2 __attribute__((__stdcall__)))(buf2d_struct *); |
extern void (*buf2d_img_wdiv2 __attribute__((__stdcall__)))(buf2d_struct *); |
extern void (*buf2d_conv_24_to_8 __attribute__((__stdcall__)))(buf2d_struct *, unsigned int); |
extern void (*buf2d_conv_24_to_32 __attribute__((__stdcall__)))(buf2d_struct *, unsigned int); |
extern void (*buf2d_bit_blt_transp __attribute__((__stdcall__)))(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 (*buf2d_convert_text_matrix __attribute__((__stdcall__)))(buf2d_struct *); |
extern void (*buf2d_draw_text __attribute__((__stdcall__)))(buf2d_struct *, buf2d_struct *, const char *, unsigned int, unsigned int); |
extern void (*buf2d_crop_color __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int); |
extern void (*buf2d_offset_h __attribute__((__stdcall__)))(buf2d_struct *, 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 (*buf2d_set_pixel __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int); |
extern unsigned int (*buf2d_get_pixel __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int); |
extern void (*buf2d_flip_h __attribute__((__stdcall__)))(buf2d_struct *); |
extern void (*buf2d_flip_v __attribute__((__stdcall__)))(buf2d_struct *); |
extern void (*buf2d_filter_dither __attribute__((__stdcall__)))(buf2d_struct *, unsigned int); |
#endif /* KOLIBRI_BUF2D_H */ |
/programs/develop/ktcc/trunk/libc.obj/include/clayer/dialog.h |
---|
2,7 → 2,6 |
#define KOLIBRI_DIALOG_H |
#include <stdlib.h> |
#define NOT_SUCCESS 0 |
#define SUCCESS 1 |
116,10 → 115,12 |
return new_colordialog; |
} |
extern void __stdcall (*OpenDialog_init)(open_dialog *); |
extern void __stdcall (*OpenDialog_start)(open_dialog *); |
extern void kolibri_dialog_init(); |
extern void __stdcall (*ColorDialog_init)(color_dialog *); |
extern void __stdcall (*ColorDialog_start)(color_dialog *); |
extern void (*OpenDialog_init __attribute__((__stdcall__)))(open_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 |
/programs/develop/ktcc/trunk/libc.obj/include/clayer/gb.h |
---|
1,5 → 1,3 |
#ifndef KOLIBRI_GB_H |
#define KOLIBRI_GB_H |
#pragma pack(push, 1) |
typedef struct |
19,5 → 17,3 |
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_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 |
/programs/develop/ktcc/trunk/libc.obj/include/clayer/http.h |
---|
5,10 → 5,11 |
Adapted for TCC's dynamic API by Magomed Kostoev, 2020 |
*/ |
#ifndef KOLIBRI_HTTP_H |
#define KOLIBRI_HTTP_H |
#ifndef _HTTP_H_ |
#define _HTTP_H_ |
#include <stddef.h> |
#define cdecl __attribute__ ((cdecl)) |
#define stdcall __attribute__ ((stdcall)) |
// Bitflags for http_msg.flags |
// status |
79,7 → 80,7 |
Initiates a HTTP connection, using 'GET' method. |
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 |
90,7 → 91,7 |
Initiate a HTTP connection, using 'HEAD' method. |
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 |
105,7 → 106,7 |
using system function 75, 6. |
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); |
/* |
127,7 → 128,7 |
In content_length you'll find the length of the content. |
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 |
136,13 → 137,13 |
This procedure can be used to send data to the server (POST) |
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: |
*/ |
extern int __stdcall (*http_free)(http_msg *identifier); |
extern int stdcall (*http_free)(http_msg *identifier); |
/* |
Free unused data |
*/ |
149,4 → 150,4 |
#define http_long_receive(x) while(http_receive(x)){}; |
#endif // KOLIBRI_HTTP_H |
#endif // _HTTP_H_ |
/programs/develop/ktcc/trunk/libc.obj/include/clayer/inputbox.h |
---|
5,12 → 5,13 |
Adapted for TCC's dynamic API by Magomed Kostoev, 2020 |
*/ |
#ifndef KOLIBRI_INPUTBOX_H |
#define KOLIBRI_INPUTBOX_H |
#ifndef __KOS__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); |
#endif // KOLIBRI_INPUTBOX_H |
#endif // __KOS__INPUTBOX__H________ |
/programs/develop/ktcc/trunk/libc.obj/include/clayer/libimg.h |
---|
6,6 → 6,10 |
#include <stddef.h> |
#include <stdbool.h> |
extern int kolibri_libimg_init(void); |
#define _stdcall __attribute__((__stdcall__)) |
//list of format id's |
#define LIBIMG_FORMAT_BMP 1 |
#define LIBIMG_FORMAT_ICO 2 |
95,23 → 99,23 |
#define ROTATE_90_CCW ROTATE_270_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* __stdcall (*img_encode)(Image* img, uint32_t length, uint32_t option); |
extern Image* __stdcall (*img_create)(uint32_t width, uint32_t height, uint32_t type); |
extern void __stdcall (*img_to_rgb2)(Image* img, void *rgb_data); |
extern Image* __stdcall (*img_to_rgb)(Image* img); |
extern bool __stdcall (*img_flip)(Image* img, uint32_t flip); |
extern bool __stdcall (*img_flip_layer)(Image *img, uint32_t flip); |
extern bool __stdcall (*img_rotate)(Image *img, uint32_t rotate); |
extern bool __stdcall (*img_rotate_layer)(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 int32_t __stdcall (*img_count)(Image *img); |
extern bool __stdcall (*img_destroy)(Image *img); |
extern bool __stdcall (*img_destroy_layer)(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* __stdcall (*img_convert)(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* __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_decode _stdcall)(void* file_data, uint32_t size, uint32_t b_color); |
extern Image* (*img_encode _stdcall)(Image* img, uint32_t length, uint32_t option); |
extern Image* (*img_create _stdcall)(uint32_t width, uint32_t height, uint32_t type); |
extern void (*img_to_rgb2 _stdcall)(Image* img, void *rgb_data); |
extern Image* (*img_to_rgb _stdcall)(Image* img); |
extern bool (*img_flip _stdcall)(Image* img, uint32_t flip); |
extern bool (*img_flip_layer _stdcall)(Image *img, uint32_t flip); |
extern bool (*img_rotate _stdcall)(Image *img, uint32_t rotate); |
extern bool (*img_rotate_layer _stdcall)(Image* data, uint32_t rotate); |
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 (*img_count _stdcall)(Image *img); |
extern bool (*img_destroy _stdcall)(Image *img); |
extern bool (*img_destroy_layer _stdcall)(Image* img); |
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* (*img_convert _stdcall)(Image *src, Image *dst, uint32_t dst_type, uint32_t, uint32_t); |
extern Image* (*img_resize_data _stdcall)(Image *src, uint32_t width, uint32_t 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){ |
for (uint32_t i = 0; i < width*height; i++) { |
/programs/develop/ktcc/trunk/libc.obj/include/clayer/msgbox.h |
---|
1,11 → 1,11 |
#ifndef KOLIBRI_MSGBOX_H |
#define KOLIBRI_MSGBOX_H |
#include <stdarg.h> |
#include <stddef.h> |
#include <stdlib.h> |
#include <string.h> |
typedef struct { |
uint8_t retval; // 0 - win closed, 1 to n - button num, also default button on start |
uint8_t reserv; |
16,9 → 16,9 |
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 __stdcall (*mb_setfunctions)(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_create __attribute__((__stdcall__)))(msgbox *, void *thread); // clears callbacks, ! if fix lib, we can return eax as of Fn51 |
extern void (*msgbox_setfunctions __attribute__((__stdcall__)))(msgbox_callback*); // must be called immediately after create, zero-ended array |
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, ...) |
/// text can be multilined by code 13 = "\r" |
48,8 → 48,8 |
static inline void kolibri_start_msgbox(msgbox* box, msgbox_callback cb[]) |
{ |
mb_create(box, &box->top_stack); |
if (cb) mb_setfunctions(cb); |
(*msgbox_create)(box, &box->top_stack); |
if (cb) (*msgbox_setfunctions)(cb); |
} |
#endif |
/programs/develop/ktcc/trunk/libc.obj/include/clayer/network.h |
---|
1,9 → 1,11 |
#ifndef KOLIBRI_NETWORK_H |
#define KOLIBRI_NETWORK_H |
#ifndef __NETWORK_H |
#define __NETWORK_H |
#include <sys/socket.h> |
#include <sys/ksys.h> |
#define stdcall __attribute__ ((stdcall)) |
#define EAI_ADDRFAMILY 1 |
#define EAI_AGAIN 2 |
#define EAI_BADFLAGS 3 |
46,9 → 48,10 |
}; |
#pragma pack(pop) |
extern int __stdcall (*inet_addr)(const char* hostname); |
extern char* __stdcall (*inet_ntoa)(int ip_addr); |
extern int __stdcall (*getaddrinfo)(const char* hostname, const char* servname, const struct addrinfo* hints, struct addrinfo** res); |
extern void __stdcall (*freeaddrinfo)(struct addrinfo* ai); |
extern int networklib_init (); |
extern int stdcall (*inet_addr)(const char* hostname); |
extern char* stdcall (*inet_ntoa)(int ip_addr); |
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 |
/programs/develop/ktcc/trunk/libc.obj/include/clayer/rasterworks.h |
---|
1,11 → 1,11 |
#ifndef 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 int __stdcall (*countUTF8Z)(const char *string, int byteQuantity) __asm__("cntUTF-8"); |
extern int __stdcall (*charsFit)(int areaWidth, int charHeight); |
extern int __stdcall (*strWidth)(int charQuantity, int charHeight); |
extern void (*drawText __attribute__((__stdcall__)))(void *canvas, int x, int y, const char *string, int charQuantity, int fontColor, int params); |
extern int (*countUTF8Z __attribute__((__stdcall__)))(const char *string, int byteQuantity); |
extern int (*charsFit __attribute__((__stdcall__)))(int areaWidth, int charHeight); |
extern int (*strWidth __attribute__((__stdcall__)))(int charQuantity, int charHeight); |
#endif /* KOLIBRI_RASTERWORKS_H */ |
#endif /* KOLIBRI_RASTERWORKS_H */ |
/programs/develop/ktcc/trunk/libc.obj/include/conio.h |
---|
11,6 → 11,9 |
#include <stddef.h> |
#define cdecl __attribute__ ((cdecl)) |
#define stdcall __attribute__ ((stdcall)) |
/* |
console.obj exports the following functions |
*/ |
35,25 → 38,25 |
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 void __stdcall _FUNC((*con_exit))(int bCloseWindow); |
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_string))(const char* str, dword length); |
extern int __cdecl _FUNC((*con_printf))(const char* format, ...); |
extern dword __stdcall _FUNC((*con_get_flags))(void); |
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_cursor_height))(void); |
extern int __stdcall _FUNC((*con_set_cursor_height))(int new_height); |
extern int __stdcall _FUNC((*con_getch))(void); |
extern word __stdcall _FUNC((*con_getch2))(void); |
extern int __stdcall _FUNC((*con_kbhit))(void); |
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); |
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_get_cursor_pos))(int* px, int* py); |
extern void __stdcall _FUNC((*con_set_cursor_pos))(int x, int y); |
extern void stdcall _FUNC((*con_exit))(int bCloseWindow); |
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_string))(const char* str, dword length); |
extern int cdecl _FUNC((*con_printf))(const char* format, ...); |
extern dword stdcall _FUNC((*con_get_flags))(void); |
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_cursor_height))(void); |
extern int stdcall _FUNC((*con_set_cursor_height))(int new_height); |
extern int stdcall _FUNC((*con_getch))(void); |
extern word stdcall _FUNC((*con_getch2))(void); |
extern int stdcall _FUNC((*con_kbhit))(void); |
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); |
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_get_cursor_pos))(int* px, int* py); |
extern void stdcall _FUNC((*con_set_cursor_pos))(int x, int y); |
extern int _FUNC(__con_is_load); |
#endif |
/programs/develop/ktcc/trunk/libc.obj/include/stddef.h |
---|
34,12 → 34,4 |
#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_ */ |
/programs/develop/ktcc/trunk/libc.obj/include/sys/ksys.h |
---|
219,7 → 219,7 |
}; |
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; } |
return(*(unsigned char*)s1 - *(unsigned char *)s2); |
1163,7 → 1163,7 |
if (!(table+i)->func_name){ |
break; |
}else{ |
if (!__strcmp(fun_name, (table+i)->func_name)){ |
if (!_ksys_strcmp(fun_name, (table+i)->func_name)){ |
return (table+i)->func_ptr; |
} |
} |