Add mdview markdown viewer, reorganize tests/examples and libc layout
- Split tests/ (libc feature tests) and examples/ (real apps); shared
app.mk in repo root, was examples/example.mk
- libc/io/* split into libc/{conio,env,errno,file,mouse,string,sys,
time,video}/ — clearer module boundaries
- New examples/mdview/: markdown viewer (Phases 1-5 + light nested
lists). Headers (H1-H4), HR, ulist/olist/quote with nesting via
leading spaces, fenced code blocks, inline emphasis (bold/italic/
underscore/code), wrap/unwrap mode with soft wrap (F2), horizontal
pan (← →) with '>' truncation indicator
- libc additions: scroll() in conio (ESTEX SCROLL), strlwr/strupr,
gets() test
- Makefile updates across tests/ for the new shared app.mk path
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
# Build cat.exe — uses lib/sprinter.lib in TINY memory mode.
|
||||
|
||||
PROJ_ROOT := $(abspath $(CURDIR)/../..)
|
||||
EXAMPLE := cat
|
||||
EXTRA_DATA := test.txt
|
||||
include $(PROJ_ROOT)/app.mk
|
||||
@@ -0,0 +1,31 @@
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int fd = open("TEST.TXT", O_RDONLY);
|
||||
if (fd < 0) {
|
||||
puts("cat: cannot open TEST.TXT");
|
||||
puts("Press any key to exit...");
|
||||
(void)getchar();
|
||||
return 1;
|
||||
}
|
||||
|
||||
puts("--- TEST.TXT ---");
|
||||
|
||||
char buf[64];
|
||||
int n;
|
||||
while ((n = read(fd, buf, sizeof(buf))) > 0) {
|
||||
for (int i = 0; i < n; i++) {
|
||||
putchar((unsigned char)buf[i]);
|
||||
}
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
||||
puts("");
|
||||
puts("--- end of file. Press any key to exit. ---");
|
||||
(void)getchar();
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
Hello from a file on disk!
|
||||
This text was read by cat.exe through
|
||||
the ESTEX file I/O syscalls:
|
||||
open ($11)
|
||||
read ($13)
|
||||
close ($12)
|
||||
|
||||
The whole loop hits real DSS code on
|
||||
the Sprinter (in MAME, just an image).
|
||||
|
||||
Line 9.
|
||||
Line 10.
|
||||
Final line.
|
||||
Reference in New Issue
Block a user