From 72a683768566a102d8aa40af17b36e16128b4ab6 Mon Sep 17 00:00:00 2001 From: pommicket Date: Wed, 4 Jan 2023 13:15:08 -0500 Subject: finish documenting what files do --- lsp-parse.c | 2 ++ lsp-write.c | 2 ++ menu.c | 2 ++ node.c | 2 ++ os-posix.c | 2 ++ os-win.c | 2 ++ pcre-inc.h | 8 ++++++++ syntax.c | 2 ++ tags.c | 2 ++ ted.c | 2 ++ text.h | 11 +++++------ ui.c | 2 ++ 12 files changed, 33 insertions(+), 6 deletions(-) diff --git a/lsp-parse.c b/lsp-parse.c index c6c15ff..7bbcbd1 100644 --- a/lsp-parse.c +++ b/lsp-parse.c @@ -1,3 +1,5 @@ +// reading messages from the LSP server + #define LSP_INTERNAL 1 #include "lsp.h" #include "util.h" diff --git a/lsp-write.c b/lsp-write.c index 48229c8..bb41d03 100644 --- a/lsp-write.c +++ b/lsp-write.c @@ -1,3 +1,5 @@ +// writing messages to the LSP server + #define LSP_INTERNAL 1 #include "lsp.h" #include "util.h" diff --git a/menu.c b/menu.c index c419e8c..84e58ca 100644 --- a/menu.c +++ b/menu.c @@ -1,3 +1,5 @@ +// deals with all of ted's menus ("open" menu, "save as" menu, etc.) + #include "ted.h" static void menu_close_with_next(Ted *ted, Menu next) { diff --git a/node.c b/node.c index f22c507..e06664f 100644 --- a/node.c +++ b/node.c @@ -1,3 +1,5 @@ +// deals with ted's split-screen feature + #include "ted.h" void node_switch_to_tab(Ted *ted, Node *node, u16 new_tab_index) { diff --git a/os-posix.c b/os-posix.c index 5b67836..0d00882 100644 --- a/os-posix.c +++ b/os-posix.c @@ -1,3 +1,5 @@ +// POSIX implementation of OS functions + #include "os.h" #include "util.h" #include diff --git a/os-win.c b/os-win.c index 4279c3f..1d0f21e 100644 --- a/os-win.c +++ b/os-win.c @@ -1,3 +1,5 @@ +// windows implementation of OS functions + #include "os.h" #include #include diff --git a/pcre-inc.h b/pcre-inc.h index 44088ec..3d8f3b9 100644 --- a/pcre-inc.h +++ b/pcre-inc.h @@ -1,3 +1,11 @@ +// includes pcre2.h with the appropriate preprocessor definitions. +// do not include pcre2.h directly. + +#ifndef PCRE_INC_H_ +#define PCRE_INC_H_ + #define PCRE2_STATIC #define PCRE2_CODE_UNIT_WIDTH 32 #include + +#endif // PCRE_INC_H_ diff --git a/syntax.c b/syntax.c index 7526f62..e72d664 100644 --- a/syntax.c +++ b/syntax.c @@ -1,3 +1,5 @@ +// syntax highlighting for ted + #include "ted.h" #include "keywords.h" diff --git a/tags.c b/tags.c index 0326735..da974b9 100644 --- a/tags.c +++ b/tags.c @@ -1,3 +1,5 @@ +// support for ctags go-to-definition and completion + #include "ted.h" #include "pcre-inc.h" diff --git a/ted.c b/ted.c index bbb83ee..6893e8b 100644 --- a/ted.c +++ b/ted.c @@ -1,3 +1,5 @@ +// various core ted functions (opening files, displaying errors, etc.) + #include "ted.h" void die(const char *fmt, ...) { diff --git a/text.h b/text.h index d396241..e5e5e61 100644 --- a/text.h +++ b/text.h @@ -1,9 +1,3 @@ -#ifndef TEXT_H_ -#define TEXT_H_ - -#include "base.h" -#include "util.h" - // A text-rendering interface. // Example usage: // Font *font = text_font_load("font.ttf", 18); @@ -13,6 +7,11 @@ // text_render(font); // } +#ifndef TEXT_H_ +#define TEXT_H_ + +#include "base.h" +#include "util.h" typedef struct Font Font; diff --git a/ui.c b/ui.c index 0a68d03..56e89db 100644 --- a/ui.c +++ b/ui.c @@ -1,3 +1,5 @@ +// various UI elements used by ted + #include "ted.h" #if __unix__ -- cgit v1.2.3