summaryrefslogtreecommitdiff
path: root/development.md
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-07-31 23:51:02 -0400
committerpommicket <pommicket@gmail.com>2023-08-01 12:54:24 -0400
commit7c5ca21fdd5fb3448376e9491528487ddb5db076 (patch)
tree4ff33aa87182f48a0e001bf1532799191b518d53 /development.md
parentf8b5606c42ba3ae35baf823c12865cc7aa68d260 (diff)
fix inconsistencies btwn xoff_to_index & rendering
Diffstat (limited to 'development.md')
-rw-r--r--development.md23
1 files changed, 17 insertions, 6 deletions
diff --git a/development.md b/development.md
index 7ad5b7d..c633885 100644
--- a/development.md
+++ b/development.md
@@ -5,21 +5,32 @@
To build the debug version of ted, run `make` (or `make.bat` on Windows).
By default we use the `ninja` build system (`sudo apt install ninja` or similar).
+## Architecture
+
+The big `Ted` struct has basically all of the data for ted.
+
+In general, fixed-size types such as `u32` should be preferred to `unsigned int` & co.
+
+
## Files
Most function declarations should go in `ted.h`.
The exceptions are only for self-contained files, like `text.c`,
which gets its own header file `text.h`.
-As much as possible, OS-dependent functions should be put in `os.h/os-*.c`.
-(But "pure" functions like `qsort_with_context`, which could
-in theory be implemented on any platform with just plain C, should be put
-in `util.c` even if they use OS-specific library functions.)
+Everything includes `base.h`, which has useful type definitions and stuff.
+This includes shorter names for fixed-size types (e.g. `i8` for `int8_t`).
+
+`util.h`/`util.c` has "utility" functions which aren't specific to ted.
+
+`os.h`/`os-*.c` has OS-dependent functions such as file system
+stuff which is (annoyingly) lacking from standard C.
## Unicode
-ted stores text as UTF-32. We assume that code points are characters.
-This is not correct for combining diacritics and will hopefully be fixed at some point.
+ted stores text as UTF-32. Left/right move by code points,
+which isn't correct for e.g. combining diacritics. Hopefully this will
+be fixed at some point.
All paths are stored as UTF-8, and annoyingly have to be converted to UTF-16 for Windows
functions (why hasn't Windows made UTF-8 versions of all their API functions yet to save