Files
snark13 737c974400 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>
2026-06-04 22:23:36 +03:00

24 lines
610 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* solid_compat.c — Solid-C compatibility helpers that need real code
* (rather than just header macros).
*
* CP866 Cyrillic support: strlwr/strupr handle uppercase/lowercase
* conversion for both Latin and Cyrillic characters in CP866 code page
* (bytes 0x800xFF).
*/
#include <sprinter_compat.h>
#include <ctype.h>
char *strupr(char *s)
{
char *p = s;
while (*p) {
if ((*p >= 'a' && *p <= 'z') || (*p >= 0xA0 && *p <= 0xAF)) *p -= 'a' - 'A';
else if ((*p >= 0xE0 && *p <= 0xEF)) *p -= 0x50;
else if ((*p == 0xF1)) *p = 0xF0;
p++;
}
return s;
}