/programs/cmm/example/example.c |
---|
File deleted |
\ No newline at end of file |
/programs/cmm/example/compile.bat |
---|
File deleted |
\ No newline at end of file |
/programs/cmm/example/Tupfile.lua |
---|
File deleted |
/programs/cmm/example |
---|
Property changes: |
Deleted: tsvn:logminsize |
-5 |
\ No newline at end of property |
/programs/cmm/examples/Tupfile.lua |
---|
0,0 → 1,7 |
if tup.getconfig("NO_CMM") ~= "" then return end |
if tup.getconfig("LANG") == "ru" |
then C_LANG = "LANG_RUS" |
else C_LANG = "LANG_ENG" -- this includes default case without config |
end |
tup.rule("example.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "example.com") |
tup.rule("collections.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "collections.com") |
/programs/cmm/examples/collections.c |
---|
0,0 → 1,17 |
#define MEMSIZE 4096*10 |
#include "../lib/io.h" |
#include "../lib/collection.h" |
void main() |
{ |
collection s; |
io.run("/sys/develop/board", ""); |
s.init(4096); |
s.add("lorem"); |
s.add("ipsum"); |
s.add("1234566"); |
debugln(s.get(0)); |
debugln(s.get(1)); |
debugln(s.get(2)); |
} |
/programs/cmm/examples/compile.bat |
---|
0,0 → 1,11 |
c-- example.c |
c-- collections.c |
@del @@example |
@del @@collections |
@rename example.com @@example |
@rename collections.com @@collections |
@del warning.txt |
@pause |
/programs/cmm/examples/example.c |
---|
0,0 → 1,46 |
#define MEMSIZE 0x3E80 |
#include "../lib/io.h" |
void main() |
{ |
int id, key, i; |
dword file; |
io.dir.load(0,DIR_ONLYREAL); |
loop() |
{ |
switch(WaitEvent()) |
{ |
case evButton: |
id=GetButtonID(); |
if (id==1) ExitProcess(); |
break; |
case evKey: |
key = GetKey(); |
if (key==013){ //Enter |
draw_window(); |
} |
break; |
case evReDraw: |
draw_window(); |
break; |
} |
} |
} |
void draw_window() |
{ |
proc_info Form; |
int i; |
i=0; |
DefineAndDrawWindow(215,100,250,200,0x34,0xFFFFFF,"Window header"); |
GetProcessInfo(#Form, SelfInfo); |
while(i<io.dir.count) |
{ |
WriteText(5,i*8+3,0x80,0xFF00FF,io.dir.position(i)); |
i++; |
} |
WriteText(10,110,0x80,0,#param); |
} |
/programs/cmm/examples |
---|
Property changes: |
Added: tsvn:logminsize |
+5 |
\ No newline at end of property |
/programs/cmm/lib/collection.h |
---|
0,0 → 1,45 |
#ifndef INCLUDE_COLLECTION_H |
#define INCLUDE_COLLECTION_H |
#print "[include <collection.h>]\n" |
struct collection |
{ |
int count; |
dword element_offset[4096]; |
dword data_size; |
dword string_data_start; |
dword string_data_cur_pos; |
void add(); |
dword get(); |
void drop(); |
void init(); |
}; |
void collection::init(dword size) { |
if (data_size) drop(); |
data_size = data_size + size; |
string_data_cur_pos = string_data_start = malloc(data_size); |
count = 0; |
} |
void collection::add(dword in) { |
strcpy(string_data_cur_pos, in); |
element_offset[count] = string_data_cur_pos; |
string_data_cur_pos += strlen(in) + 1; |
count++; |
} |
dword collection::get(dword pos) { |
return element_offset[pos]; |
} |
void collection::drop() { |
if (string_data_start) free(string_data_start); |
data_size = |
string_data_start = |
string_data_cur_pos = |
count = 0; |
} |
#endif |
/programs/cmm/textreader/compile.bat |
---|
3,4 → 3,4 |
@rename "textreader.com" "textreader" |
@del warning.txt |
@pause |
rem kpack textreader |
kpack textreader |