737c974400
- 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>
40 lines
1.3 KiB
C
40 lines
1.3 KiB
C
/*
|
|
* fcntl.h — open / creat for Sprinter ESTEX.
|
|
*
|
|
* POSIX-style flag bits. The low two bits select access mode (matches
|
|
* POSIX numbering — RDONLY=0, WRONLY=1, RDWR=2 — and is translated to
|
|
* the ESTEX OPEN $11 convention inside open()).
|
|
*
|
|
* The other flags map onto ESTEX calls like this:
|
|
* O_CREAT + O_EXCL → $0B (CREATE_NEW, fails if exists)
|
|
* O_CREAT + O_TRUNC → $0A (CREATE, truncates existing)
|
|
* O_CREAT alone → try $11 (OPEN); on ENOENT fall back to $0A
|
|
* no O_CREAT → $11 (OPEN, fails if missing)
|
|
* O_APPEND → after open, $15 lseek(0, SEEK_END)
|
|
*/
|
|
|
|
#ifndef FCNTL_H
|
|
#define FCNTL_H
|
|
|
|
#ifndef _STD_SEEK_
|
|
#define _STD_SEEK_
|
|
/* constants to be used as 3rd argument for "fseek" function */
|
|
#define SEEK_SET 0
|
|
#define SEEK_CUR 1
|
|
#define SEEK_END 2
|
|
#endif
|
|
|
|
/* Definition "open flags" */
|
|
#define O_WRONLY 0x01 /* 0 file write only */
|
|
#define O_RDONLY 0x02 /* 1 file read only */
|
|
#define O_RDWR 0x03 /* 1,0 file read/write */
|
|
#define O_TRUNC 0x04 /* 2 open with truncation */
|
|
#define O_CREAT 0x08 /* 3 create and open file */
|
|
#define O_EXCL 0x10 /* 4 exclusive open */
|
|
#define O_APPEND 0x20 /* 5 to end of file */
|
|
|
|
int open (const char *path, int flags);
|
|
int creat(const char *path, int mode); /* mode arg ignored on Sprinter */
|
|
|
|
#endif
|