/* Copyright (c) 2021 nytpu * SPDX-License-Identifier: GPL-3.0-only * For more license details, see LICENSE or . */ #pragma once #ifndef _IO_H #define _IO_H #include "common.h" #include // load the specified file into buffer. will re-initialize buffer void open_file(const char *filename, bool force); // write buffer to given filename, or use saved filename if argument is NULL // Return: 0 on success, -1 on error int write_file(const char *filename); // print rows in range [from. to) int print_rows(RowNum from, RowNum to); int print_rows_numbered(RowNum from, RowNum to); int print_rows_escaped(RowNum from, RowNum to); // enter into insert mode, inserting new lines /at/ target RowNum (shifting // other rows down) void insert_mode(RowNum target); #endif // _IO_H