Rev 3363 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3363 | Rev 4718 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #define MEMSIZE 0x3E80 |
1 | #define MEMSIZE 0x3E80 |
2 | #include "..\lib\kolibri.h" |
2 | #include "..\lib\kolibri.h" |
3 | #include "..\lib\strings.h" |
3 | #include "..\lib\strings.h" |
- | 4 | #include "..\lib\mem.h" |
|
4 | #include "..\lib\file_system.h" |
5 | #include "..\lib\file_system.h" |
Line -... | Line 6... | ||
- | 6 | ||
- | 7 | void str_replace(dword buf_in, what_replace, to_what_replace) { |
|
- | 8 | dword start_pos=0; |
|
- | 9 | dword buf_from; |
|
- | 10 | ||
- | 11 | buf_from = malloc(strlen(buf_in)); |
|
- | 12 | loop() { |
|
- | 13 | strcpy(buf_from, buf_in); |
|
- | 14 | start_pos = strstr(buf_from, what_replace); |
|
- | 15 | if (start_pos == 0) break; |
|
- | 16 | strlcpy(buf_in, buf_from, start_pos-buf_from); |
|
- | 17 | strcat(buf_in, to_what_replace); |
|
- | 18 | start_pos += strlen(what_replace); |
|
- | 19 | strcat(buf_in, start_pos); |
|
- | 20 | } |
|
- | 21 | free(buf_from); |
|
Line 5... | Line 22... | ||
5 | 22 | } |
|
6 | 23 | ||
7 | void main() |
24 | void main() |
- | 25 | { |
|
- | 26 | int id, key; |
|
- | 27 | strcpy(#param, " lorem"); |
|
Line 8... | Line 28... | ||
8 | { |
28 | str_replace(#param, "<", "<"); |
9 | int id, key; |
29 | str_replace(#param, ">", ">"); |
10 | 30 | ||
11 | loop() |
31 | loop() |
Line 36... | Line 56... | ||
36 | { |
56 | { |
37 | proc_info Form; |
57 | proc_info Form; |
38 | DefineAndDrawWindow(215,100,250,200,0x34,0xFFFFFF,"Window header"); |
58 | DefineAndDrawWindow(215,100,250,200,0x34,0xFFFFFF,"Window header"); |
39 | GetProcessInfo(#Form, SelfInfo); |
59 | GetProcessInfo(#Form, SelfInfo); |
40 | WriteText(50,80,0x80,0,"Press Enter"); |
60 | WriteText(50,80,0x80,0,"Press Enter"); |
- | 61 | WriteText(10,110,0x80,0,#param); |
|
41 | } |
62 | } |
Line 42... | Line 63... | ||
42 | 63 |