add: base with add function

This commit is contained in:
2023-07-24 04:05:26 +02:00
parent 7c160040b3
commit 85ab7c292a
5 changed files with 65 additions and 2 deletions

View File

@ -0,0 +1,24 @@
define BUFFER_SIZE=1000;
main()
{
local text;
local line_pos;
local line;
local cmd;
line_pos = 0;
text = strdup("");
if (text == NULL)
return 1;
cmd = 0;
loop
{
line = geadline("(default)");
if (line == NULL)
return;
if (strcmp(line, "a\n") == 0)
cmd_add(&text, line_pos);
putstr(text);
}
}