1,32 → 1,12 |
#define MEMSIZE 0x3E80 |
#include "..\lib\kolibri.h" |
#include "..\lib\strings.h" |
#include "..\lib\mem.h" |
#include "..\lib\file_system.h" |
|
void str_replace(dword buf_in, what_replace, to_what_replace) { |
dword start_pos=0; |
dword buf_from; |
|
buf_from = malloc(strlen(buf_in)); |
loop() { |
strcpy(buf_from, buf_in); |
start_pos = strstr(buf_from, what_replace); |
if (start_pos == 0) break; |
strlcpy(buf_in, buf_from, start_pos-buf_from); |
strcat(buf_in, to_what_replace); |
start_pos += strlen(what_replace); |
strcat(buf_in, start_pos); |
} |
free(buf_from); |
} |
|
void main() |
{ |
int id, key; |
strcpy(#param, " <html>lorem</html>"); |
str_replace(#param, "<", "<"); |
str_replace(#param, ">", ">"); |
|
loop() |
{ |
58,7 → 38,6 |
DefineAndDrawWindow(215,100,250,200,0x34,0xFFFFFF,"Window header"); |
GetProcessInfo(#Form, SelfInfo); |
WriteText(50,80,0x80,0,"Press Enter"); |
WriteText(10,110,0x80,0,#param); |
} |
|
|