|
tape-kernel 1.0
a modular modern independent kernel
|
#include "../io/vga.h"#include "../lib/utils.h"#include "editor.h"#include "../io/cm.h"#include "../fs/fs.h"#include "../io/kb.h"#include "../lib/pit.h"
Go to the source code of this file.
Macros | |
| #define | MAX_LINES 32 |
| #define | MAX_LINE_LEN 80 |
Functions | |
| static void | editor_display (const char *filename) |
| editor_display renders the editor interface to the screen | |
| static void | editor_load (const char *filename) |
| editor_load loads a files contents into the editor buffer | |
| static void | editor_save (const char *filename) |
| editor_save writes the editor buffer to the filesystem | |
| void | __editor (const char *filename) |
| a simple multiline text editor | |
Variables | |
| arena_t * | fs_arena |
| the filesystem child arena | |
| static char | lines [32][80+1] |
| static int | line_count = 0 |
| #define MAX_LINE_LEN 80 |
Definition at line 11 of file editor.c.
Referenced by __editor(), editor_load(), and editor_save().
| #define MAX_LINES 32 |
Definition at line 10 of file editor.c.
Referenced by __editor(), editor_load(), and editor_save().
| void __editor | ( | const char * | filename | ) |
a simple multiline text editor
to call this editor simply use
and it will automatically break back to your loop or func (not exit)
Definition at line 120 of file editor.c.
References clscr, cob, delay, editor_display(), editor_load(), editor_save(), gtchr, line_count, lines, MAX_LINE_LEN, MAX_LINES, NULL, prt, and rdln.
|
static |
editor_display renders the editor interface to the screen
editor_display is a static function that clears the screen and draws the editor header, hotkeys bar, and all current lines
| filename,the | name of the file being edited |
Definition at line 27 of file editor.c.
References clscr, cob, line_count, lines, and prt.
Referenced by __editor().
|
static |
editor_load loads a files contents into the editor buffer
editor_load is a static function that reads a file from the filesystem and splits its content into lines for editing
| filename,the | name of the file to load |
Definition at line 50 of file editor.c.
References fsread, line_count, lines, MAX_LINE_LEN, MAX_LINES, and NULL.
Referenced by __editor().
|
static |
editor_save writes the editor buffer to the filesystem
editor_save is a static function that joins all lines with newlines and writes the combined content to disk as a file
| filename,the | name of the file to save to |
Definition at line 88 of file editor.c.
References fs_arena, fswrite, line_count, lines, MAX_LINE_LEN, MAX_LINES, and prt.
Referenced by __editor().
|
extern |
|
static |
Definition at line 16 of file editor.c.
Referenced by __editor(), editor_display(), editor_load(), and editor_save().
|
static |
Definition at line 15 of file editor.c.
Referenced by __editor(), __shell(), cmd_readfile(), editor_display(), editor_load(), and editor_save().