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,3 @@
|
||||
PROJ_ROOT := $(abspath $(CURDIR)/../..)
|
||||
EXAMPLE := dec_test
|
||||
include $(PROJ_ROOT)/app.mk
|
||||
@@ -0,0 +1,39 @@
|
||||
#include <stdio.h>
|
||||
extern void dec8 (unsigned char);
|
||||
extern void dec16(unsigned int);
|
||||
extern void dec32(unsigned long);
|
||||
extern void hex8 (unsigned char);
|
||||
extern void hex16(unsigned int);
|
||||
extern void hex32(unsigned long);
|
||||
|
||||
int main(void) {
|
||||
puts("hex8:");
|
||||
hex8(0x00); puts("");
|
||||
hex8(0x5A); puts("");
|
||||
hex8(0xFF); puts("");
|
||||
puts("hex16:");
|
||||
hex16(0x0000); puts("");
|
||||
hex16(0xCAFE); puts("");
|
||||
hex16(0xFFFF); puts("");
|
||||
puts("hex32:");
|
||||
hex32(0x00000000UL); puts("");
|
||||
hex32(0xDEADBEEFUL); puts("");
|
||||
hex32(0xFFFFFFFFUL); puts("");
|
||||
puts("dec8:");
|
||||
dec8(0); puts("");
|
||||
dec8(42); puts("");
|
||||
dec8(255); puts("");
|
||||
puts("dec16:");
|
||||
dec16(0); puts("");
|
||||
dec16(1234); puts("");
|
||||
dec16(65535); puts("");
|
||||
puts("dec32:");
|
||||
dec32(0UL); puts("");
|
||||
dec32(98765UL); puts("");
|
||||
dec32(123456UL); puts("");
|
||||
dec32(123456789UL); puts("");
|
||||
dec32(4294967295UL); puts("");
|
||||
puts("done — any key");
|
||||
(void)getchar();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user