aboutsummaryrefslogtreecommitdiffstats
path: root/buffer.h
blob: f85b31f0bc98b0e168df9900857ac8864af003c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* Copyright (c) 2021 nytpu <alex@nytpu.com>
 * SPDX-License-Identifier: GPL-3.0-only
 * For more license details, see LICENSE or <https://www.gnu.org/licenses/gpl-3.0.html>.
 */

#pragma once
#ifndef _BUFFER_H
#define _BUFFER_H

#include "common.h"

#include <stdlib.h>

// check if at is in range [1, top]
bool in_bounds(RowNum at, RowNum top);

// insert a row at the specified position, moving other rows if necessary
void insert_row(RowNum at, char *r, size_t len);

// delete a row at the specified position, moving other rows if necessary
void delete_row(RowNum at);
// delete rows in range [from, to]
void delete_rows(RowNum from, RowNum to);

#endif // _BUFFER_H