|
Assembled 2
A column based text editor
|
#include <editor/buffer/buffer.h>#include <editor/config.h>#include <editor/buffer/editor.h>#include <global.h>#include <stdio.h>#include <includes.h>Functions | |
| void | load_file_content (struct AS_TextFile *text_file) |
| struct AS_TextFile * | load_file (char *name) |
| void | reload_file (struct AS_TextFile *file) |
| void | reload_all () |
| void | save_file (struct AS_TextFile *file) |
| void | save_all () |
| void | destroy_file (struct AS_TextFile *file) |
| void | destroy_all () |
| struct AS_CfgTok * | configure_editor (struct AS_CfgTok *token) |
Assembled - Column based text editor Copyright (C) 2023-2024 awewsomegamer
This file is apart of Assembled.
Assembled is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Handles files.
Function to configure the editor.
This function is invoked by config.c's interpret_token_stream function. The current element is passed, which should be of type AS_CFG_TOKEN_KEY and of value AS_CFG_LOOKUP_COLUMNS.
This function will initialize the user's columns into as_ctx.col_descs.
| struct | AS_CfgTok *token - Pointer to starting token of the editor's configuration. |
| void destroy_all | ( | ) |
Wrapper of destroy_file to destroy all files in the list as_ctx.text_file_head.
| void destroy_file | ( | struct AS_TextFile * | file | ) |
Destroy the given file
Free the memory of the given file.
This does not save the contents of the file in memory to the file on disk.
| struct | AS_TextFile *file - The file to destroy. |
| struct AS_TextFile * load_file | ( | char * | name | ) |
Load a file into a struct AS_TextFile.
Loads the file from the given file path into the internal struct AS_TextBuf and as struct AS_TextFile representations.
| char | *name - Path to the file. |
| void load_file_content | ( | struct AS_TextFile * | text_file | ) |
Load the content of a file in the format of struct AS_TextBuf.
| struct | AS_TextFile *text_file - The text file who's content needs to be loaded |
| void reload_all | ( | ) |
Wrapper of reload_file to reload all files in the list as_ctx.text_file_head.
| void reload_file | ( | struct AS_TextFile * | file | ) |
Reloads the given file.
| struct | AS_TextFile *file - The file to reload. |
| void save_all | ( | ) |
Wrapper of save_file to save all files in the list as_ctx.text_file_head.
| void save_file | ( | struct AS_TextFile * | file | ) |
Save the given file.
| struct | AS_TextFile * - The file to save. |